public void addModifierAction(Object device, Integer modifier, ActionAttributes action) { this.addModifierActionList(device, modifier); DeviceModifierMap modActionMap = this.getModifierActionMap(device); ActionAttributesList actionList = (ActionAttributesList) modActionMap.get(modifier); actionList.remove(action); actionList.add(action); }
public void addModifierActionList(Object device, Integer modifier) { DeviceModifierMap deviceActionMap = this.getModifierActionMap(device); if (deviceActionMap == null) { deviceActionMap = new DeviceModifierMap(); this.setModifierActionMap(device, deviceActionMap); } ArrayList modifierList = deviceActionMap.get(modifier); if (modifierList == null) { deviceActionMap.put(modifier, new ActionAttributesList()); } }