Package jadex.rules.eca.propertychange
Class PropertyChangeManager
- java.lang.Object
-
- jadex.rules.eca.propertychange.PropertyChangeManager
-
- Direct Known Subclasses:
PropertyChangeManagerDesktop
public class PropertyChangeManager extends java.lang.Object
Basic property change manager w/o java bean support. Works on android, too.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<IEvent>
events
The event list.protected static java.lang.Class<?>[]
PCL
The argument types for property change listener adding/removal (cached for speed).protected java.util.Map<java.lang.Object,java.util.Map<IResultCommand<IFuture<java.lang.Void>,PropertyChangeEvent>,java.lang.Object>>
pcls
The property change listeners.
-
Constructor Summary
Constructors Modifier Constructor Description protected
PropertyChangeManager()
Protected Constructor to prevent direct instantiation
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEvent(IEvent event)
Add an event.void
addPropertyChangeListener(java.lang.Object object, IResultCommand<IFuture<java.lang.Void>,PropertyChangeEvent> eventadder)
Add a property change listener.static PropertyChangeManager
createInstance()
Returns a new PropertyChangeManager instanceprotected java.lang.Object
createPCL(java.lang.reflect.Method meth, IResultCommand<IFuture<java.lang.Void>,PropertyChangeEvent> eventadder)
Create a listener.protected java.lang.reflect.Method
getAddMethod(java.lang.Object object)
Get listener add methodint
getSize()
Get the number of events.boolean
hasEvents()
Test if events are available.IEvent
removeEvent(int index)
Remove an event.protected void
removePCL(java.lang.Object object, java.lang.Object pcl)
Remove a listener from an object.void
removePropertyChangeListener(java.lang.Object object, IResultCommand<IFuture<java.lang.Void>,PropertyChangeEvent> eventadder)
Deregister a value for observation.
-
-
-
Field Detail
-
events
protected java.util.List<IEvent> events
The event list.
-
pcls
protected java.util.Map<java.lang.Object,java.util.Map<IResultCommand<IFuture<java.lang.Void>,PropertyChangeEvent>,java.lang.Object>> pcls
The property change listeners. Listener type must be object, because java.beans.PropertyChangeListener/jadex.commons.beans.PropertyChangeListener don't share an interface
-
PCL
protected static java.lang.Class<?>[] PCL
The argument types for property change listener adding/removal (cached for speed).
-
-
Method Detail
-
createInstance
public static PropertyChangeManager createInstance()
Returns a new PropertyChangeManager instance
-
removePCL
protected void removePCL(java.lang.Object object, java.lang.Object pcl)
Remove a listener from an object.
-
addPropertyChangeListener
public void addPropertyChangeListener(java.lang.Object object, IResultCommand<IFuture<java.lang.Void>,PropertyChangeEvent> eventadder)
Add a property change listener.
-
removePropertyChangeListener
public void removePropertyChangeListener(java.lang.Object object, IResultCommand<IFuture<java.lang.Void>,PropertyChangeEvent> eventadder)
Deregister a value for observation. if its a bean then remove the property listener.
-
addEvent
public void addEvent(IEvent event)
Add an event.
-
hasEvents
public boolean hasEvents()
Test if events are available.- Returns:
- True, if has events.
-
removeEvent
public IEvent removeEvent(int index)
Remove an event.- Parameters:
index
- The index.
-
getSize
public int getSize()
Get the number of events.- Returns:
- The number of events.
-
createPCL
protected java.lang.Object createPCL(java.lang.reflect.Method meth, IResultCommand<IFuture<java.lang.Void>,PropertyChangeEvent> eventadder)
Create a listener.
-
getAddMethod
protected java.lang.reflect.Method getAddMethod(java.lang.Object object)
Get listener add method
-
-