/** * Removes an attribute value. * * @param name The attribute name. * @param value The attribute value. */ public void removeValue(String name, Object value) { if(values.containsKey(name)) { values.remove(name, value); } }
/** * Get an empty location. * @return The location. */ protected Location getEmptyLocation() { Location ret = null; while(ret==null) { ret = new Location(rand.nextInt(sizex), rand.nextInt(sizey)); if(world.containsKey(ret)) { ret = null; } } return ret; }
/** * Returns true if the filter contains the given attribute value. * * @param name The attribute name. * @param value The attribute value. * @return true if the filter contains the given attribute value. */ public boolean containsValue(String name, Object value) { if(values.containsKey(name)) { Collection vals = values.getCollection(name); if(vals.contains(value)) { return true; } } return false; }
/** * An element was added. * @param type The element type used as prefix for the event (e.g. use 'goal' for 'goal_added' events). * @param value The element value (must be transferable). */ public void elementAdded(String type, Object value) { if(!removed.containsKey(type) || !removed.getCollection(type).remove(value)) { if(changed.containsKey(type)) changed.getCollection(type).remove(value); added.put(type, value); } startTimer(); }
/** * An element was removed. * @param type The element type used as prefix for the event (e.g. use 'goal' for 'goal_removed' events). * @param value The element value (must be transferable). */ public void elementRemoved(String type, Object value) { if(!added.containsKey(type) || !added.getCollection(type).remove(value)) { if(changed.containsKey(type)) changed.getCollection(type).remove(value); removed.put(type, value); } startTimer(); }
/** * An element was added. * @param type The element type used as prefix for the event (e.g. use 'goal' for 'goal_added' events). * @param value The element value (must be transferable). */ public void elementAdded(String type, Object value) { if(!removed.containsKey(type) || !removed.getCollection(type).remove(value)) { if(changed.containsKey(type)) changed.getCollection(type).remove(value); added.add(type, value); } startTimer(); }
/** * An element was removed. * @param type The element type used as prefix for the event (e.g. use 'goal' for 'goal_removed' events). * @param value The element value (must be transferable). */ public void elementRemoved(String type, Object value) { if(!added.containsKey(type) || !added.getCollection(type).remove(value)) { if(changed.containsKey(type)) changed.getCollection(type).remove(value); removed.add(type, value); } startTimer(); }
/** * Remove a creature to the world. * @param creature The creature. */ public boolean removeCreature(Creature creature) { // Remove tasks of this creature. int tasks = tasklist.size(); for(Iterator it=tasklist.iterator(); it.hasNext(); ) { TaskInfo task = (TaskInfo) it.next(); Object[] params = (Object[])task.getAction(); if(creature.equals(params[1])) { // System.out.println("Removed: "+task); it.remove(); } } this.pcs.firePropertyChange("taskSize", tasks, tasklist.size()); if(this.world.containsKey(creature.getLocation())) this.world.removeObject(creature.getLocation(), creature); return this.creatures.remove(creature)!=null; }
/** * An element was changed. * @param type The element type used as prefix for the event (e.g. use 'goal' for 'goal_changed' events). * @param value The element value (must be transferable). */ public void elementChanged(String type, Object value) { if(!removed.containsKey(type) || !removed.getCollection(type).remove(value)) { if(added.containsKey(type) && added.getCollection(type).remove(value)) { // Replace added element. added.put(type, value); } else { // Hack!!! Remove before add, because set does not replace. changed.getCollection(type).remove(value); changed.put(type, value); } } startTimer(); }
/** * An element was changed. * @param type The element type used as prefix for the event (e.g. use 'goal' for 'goal_changed' events). * @param value The element value (must be transferable). */ public void elementChanged(String type, Object value) { if(!removed.containsKey(type) || !removed.getCollection(type).remove(value)) { if(added.containsKey(type) && added.getCollection(type).remove(value)) { // Replace added element. added.add(type, value); } else { // Hack!!! Remove before add, because set does not replace. changed.getCollection(type).remove(value); changed.add(type, value); } } startTimer(); }
if(entries.containsKey(ancestor))
if(entries.containsKey(ancestor))
if(objectsygridpos.containsKey(ret)) ret = null; if(objectsygridpos.containsKey(ret)) ret = null;
if(tasklisteners!=null && tasklisteners.containsKey(taskid))
if(objectsygridpos.containsKey(ret)) ret = null; if(objectsygridpos.containsKey(ret)) ret = null;
if(futures==null || !futures.containsKey(cid)) SRemoteGui.deregisterRemoteCMSListener(access, cid, buildId(cid)).addResultListener(crl); else
if(tasklisteners!=null && tasklisteners.containsKey(atasks[i].getProperty(IObjectTask.PROPERTY_ID)))
if(!listeners.containsKey(cid))
if(objectsygridpos.containsKey(oldpos))
if(objectsygridpos.containsKey(oldpos))