From: <jom...@us...> - 2010-08-18 22:25:03
|
Revision: 1608 http://jason.svn.sourceforge.net/jason/?rev=1608&view=rev Author: jomifred Date: 2010-08-18 22:24:57 +0000 (Wed, 18 Aug 2010) Log Message: ----------- change the CircListener methods Modified Paths: -------------- trunk/src/jason/asSemantics/Circumstance.java trunk/src/jason/bb/IndexedBB.java Modified: trunk/src/jason/asSemantics/Circumstance.java =================================================================== --- trunk/src/jason/asSemantics/Circumstance.java 2010-08-10 21:46:04 UTC (rev 1607) +++ trunk/src/jason/asSemantics/Circumstance.java 2010-08-18 22:24:57 UTC (rev 1608) @@ -65,7 +65,7 @@ private Map<String, Intention> PI; // pending intentions, intentions suspended by any other reason - private List<CircumstanceListener> listeners = null; + private List<CircumstanceListener> listeners = new CopyOnWriteArrayList<CircumstanceListener>(); public Circumstance() { create(); @@ -152,21 +152,22 @@ /** Listeners */ public void addEventListener(CircumstanceListener el) { - if (listeners == null) - listeners = new CopyOnWriteArrayList<CircumstanceListener>(); + //if (listeners == null) + // listeners = new CopyOnWriteArrayList<CircumstanceListener>(); listeners.add(el); } public void removeEventListener(CircumstanceListener el) { if (el != null) { listeners.remove(el); - if (listeners.isEmpty()) - listeners = null; + //if (listeners.isEmpty()) + // listeners = null; } } public boolean hasListener() { - return listeners != null && !listeners.isEmpty(); + //return listeners != null && !listeners.isEmpty(); + return !listeners.isEmpty(); } public Collection<CircumstanceListener> getListeners() { Modified: trunk/src/jason/bb/IndexedBB.java =================================================================== --- trunk/src/jason/bb/IndexedBB.java 2010-08-10 21:46:04 UTC (rev 1607) +++ trunk/src/jason/bb/IndexedBB.java 2010-08-18 22:24:57 UTC (rev 1608) @@ -17,7 +17,7 @@ * indexed for faster access. * * <p>E.g. in a .mas2j project file:<br/> - * <code>agents: bob beliefBaseClass agent.IndexedBB("student(key,_)", "depot(_,_,_)")</code> + * <code>agents: bob beliefBaseClass jason.bb.IndexedBB("student(key,_)", "depot(_,_,_)")</code> * <br/> * The belief "student/2" has the first argument as its key, so the BB will never has * two students with the same key. Or, two students in the BB will have two different keys. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |