/** * Add a property. * @param key The key. * @param value The value. */ public void addProperty(String key, Object value) { // System.out.println("addP: "+key+" "+value); if(properties==null) properties = new MultiCollection<String, Object>(); properties.add(key, value); }
/** * Get a property. * @param key The key. * @return The value. */ public List<Object> getPropertyList(String key) { return properties!=null? (List)properties.get(key): null; }
/** * 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(); }
/** * Add a child. */ public void addChild(Object key, Object value) { if(children==null) children = new MultiCollection(); children.put(key, value); }
/** * 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); } }
MultiCollection managers = new MultiCollection(); String recid = type.getReceiverIdentifier(); Object tmp = msgcopy.get(recid); managers.put(sm, cid); managers.put(sm, cid); CounterResultListener<Void> crl = new CounterResultListener<Void>(managers.size(), false, new DelegationResultListener<Void>(ret)); for(Iterator<?> it=managers.keySet().iterator(); it.hasNext();) IComponentIdentifier[] recs = (IComponentIdentifier[])managers.getCollection(tm).toArray(new IComponentIdentifier[0]);
/** * Add an injection field. * @param name The name. * @param field The field. */ public void addServiceInjection(String name, FieldInfo field) { if(serviceinjections==null) serviceinjections = new MultiCollection(); serviceinjections.put(name, field); }
MultiCollection<SendManager, IComponentIdentifier> managers = new MultiCollection<SendManager, IComponentIdentifier>(); String recid = type.getReceiverIdentifier(); Object tmp = msgcopy.get(recid); ITransportComponentIdentifier tcid = TransportAddressService.getTransportComponentIdentifier(cid, taddresses); SendManager sm = getSendManager(tcid); managers.add(sm, tcid); ITransportComponentIdentifier tcid = TransportAddressService.getTransportComponentIdentifier(cid, taddresses); SendManager sm = getSendManager(tcid); managers.add(sm, tcid); final CounterResultListener<Void> crl = new CounterResultListener<Void>(managers.size(), false, new DelegationResultListener<Void>(ret)); for(Iterator<?> it=managers.keySet().iterator(); it.hasNext();) ITransportComponentIdentifier[] recs = managers.getCollection(tm).toArray(new ITransportComponentIdentifier[0]); MapSendTask task = new MapSendTask(msgcopy, type, recs, getTransports(), codecs, cl, enccontext); tm.addMessage(task).addResultListener(crl);
MultiCollection<Tuple, String> report = new MultiCollection<Tuple, String>(new IndexMap().getAsMap(), LinkedHashSet.class); user.put(CONTEXT_ENTRIES, report); user.put(SEQUENCE_EDGES, new HashMap<String, MSequenceEdge>()); report.add(new Tuple(new Object[]{new StackElement(new QName("BpmnDiagram"), ret)}), "Name '"+ret.getModelInfo().getName()+"' does not match file name '"+ret.getModelInfo().getFilename()+"'."); report.add(new Tuple(new Object[]{new StackElement(new QName("BpmnDiagram"), ret)}), "Package '"+ret.getModelInfo().getPackage()+"' does not match file name '"+ret.getModelInfo().getFilename()+"'."); if(report.size()>0)
MultiCollection report = new MultiCollection(new IndexMap().getAsMap(), LinkedHashSet.class); user.put(CONTEXT_ENTRIES, report); user.put(SEQUENCE_EDGES, new HashMap<String, MSequenceEdge>()); report.put(new Tuple(new Object[]{new StackElement(new QName("BpmnDiagram"), ret)}), "Name '"+ret.getModelInfo().getName()+"' does not match file name '"+ret.getModelInfo().getFilename()+"'."); report.put(new Tuple(new Object[]{new StackElement(new QName("BpmnDiagram"), ret)}), "Package '"+ret.getModelInfo().getPackage()+"' does not match file name '"+ret.getModelInfo().getFilename()+"'."); if(report.size()>0)
/** * Get the action types for a percept. * @param pt The percept type. */ protected Set<String> getActionTypes(PerceptType pt) { if(actiontypes==null) { actiontypes = new MultiCollection<String, String>(new HashMap(), HashSet.class); Object[] percepttypes = getPerceptTypes(); for(int i=0; i<percepttypes.length; i++) { String[] per = (String[])percepttypes[i]; for(int j=1; j<per.length; j++) { actiontypes.add(per[0], per[j]); } } } Set<String> ret = (Set<String>)actiontypes.get(pt.getName()); return ret==null? Collections.EMPTY_SET: ret; }
/** * Add an entry to the report. * @param stack The path to the element to which the entry applies. * @param message The problem description. */ public void addEntry(Tuple stack, String message) { if(entries==null) // Use index map to keep insertion order for elements. this.entries = new MultiCollection(new IndexMap().getAsMap(), LinkedHashSet.class); if(!entries.getCollection(stack).contains(message)) entries.put(stack, message); }
if(tasklisteners!=null && tasklisteners.containsKey(taskid)) Collection<IResultListener<?>> listeners = tasklisteners.getCollection(taskid); for(Iterator it=listeners.iterator(); it.hasNext(); ) tasklisteners.remove(taskid); if(tasklisteners.isEmpty()) tasklisteners = null;
/** * 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(); }
this.playerModels.add(dealer, new Tuple(Integer.valueOf(dealer.getGameCount()), Integer.valueOf(dealer.getAccount()))); for(int i=0; i<players.length; i++) this.playerModels.add(players[i], new Tuple(Integer.valueOf(dealer.getGameCount()), Integer.valueOf(players[i].getAccount()))); maxRound = playerModels.getCollection(dealer).size(); Iterator it = playerModels.keySet().iterator(); while (it.hasNext()) List playerData = (List)playerModels.getCollection(player);
MultiCollection zipentries = jad.createEntries(); final CollectionResultListener<Tuple2<String, RemoteJarFile>> lis = new CollectionResultListener<Tuple2<String, RemoteJarFile>>(zipentries.size(), true, new ExceptionDelegationResultListener<Collection<Tuple2<String, RemoteJarFile>>, Collection<FileData>>(ret) for(Iterator<?> it=zipentries.keySet().iterator(); it.hasNext(); ) Collection<?> childs = (Collection<?>)zipentries.get(name);
/** * Add a mapping from object type to data view * @param objecttype The object type. * @param view Settings for view creation. */ public void addDataViewMapping(String objecttype, Map view) { synchronized(monitor) { dataviewmappings.add(objecttype, view); } }
public void customResultAvailable(Void result) { assert SwingUtilities.isEventDispatchThread(); if(futures!=null) // Todo: can be null? { Collection<?> coll = futures.getCollection(cid); for(Iterator<?> it=coll.iterator(); it.hasNext(); ) { ((Future<?>)it.next()).setResult(null); } futures.remove(cid); if(futures.isEmpty()) futures = null; } } public void customExceptionOccurred(Exception exception)