|
LEONARDI Application Composer - 8.9.0.40 by W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectleon.data.LyObjectList
leon.data.LyWorkSpace
public abstract class LyWorkSpace
This class implements workspaces. Workspaces are dynamic objects lists : lists that send events to listeners when their content changes.
A workspace is constructed within a session and is only accessible in that session.
Different types of workspaces are provided, they are implemented as subclasses of this abstract class and correspond to different needs (see inherited classes).
A workspace can be local, that is all objects are searched from memory.
When workspaces are not used anymore, they should be freed via free method to release resources they use to keep themselves up to date. This point is rather important because if they are not freed, they can't be removed by garbage collector and may still use memory and CPU for nothing.
LyWorkSpaceEvent
,
LyAdvancedWorkSpaceEvent
,
LyWorkSpaceListener
,
LyAdvancedWorkSpaceListener
Field Summary | |
---|---|
static java.lang.String |
__VERSION
|
Method Summary | |
---|---|
void |
addList(LyObjectList list)
Adds objects of the specified list to this list. |
void |
addListener(LyWorkSpaceListener listener)
Adds a listener on this workspace. |
boolean |
dataSourceEventsGrouped(java.util.ArrayList<LyDataSourceEvent> events)
Called when grouped events are sent. |
boolean |
free(LyWorkSpaceListener listener)
Remove the given listener of this workspace and free workspace if this listener was the last. |
LyWorkSpaceListener |
getListener(int index)
Gets listener at the given position. |
int |
getListenerCount()
Gets number of listeners of this workspace. |
LyDataSession |
getSession()
Gets session on which this workspace was built. |
LySimpleObjectList |
getSources(LyObject target)
Method for retrieving source objects that lead to given target object. |
boolean |
isDynamic()
Checks whether this workspace is dynamic or not. |
boolean |
isLocal()
Checks whether this workspace is local or not. |
void |
lock()
Lock this workspace. |
boolean |
objectCreated(LyDataSourceEvent event)
Method for receiving an object creation. |
boolean |
objectDeleted(LyDataSourceEvent event)
Method for receiving an object deletion. |
boolean |
objectModified(LyDataSourceEvent event)
Method for receiving an object modification. |
boolean |
objectStateChanged(LyAdvancedDataSourceEvent event)
Called when an object state is changed. |
boolean |
objectUserEvent(LyAdvancedDataSourceEvent event)
Method for receiving user event on an object. |
void |
removeListener(LyWorkSpaceListener listener)
Removes a listener on this workspace. |
void |
reset()
Method for resetting a workspace. |
void |
unlock()
Unlock this workspace. |
Methods inherited from class leon.data.LyObjectList |
---|
contains, delete, delete, equals, equals, getClasses, getIndex, getIntersection, getList, getList, getList, getList, getList, getList, getList, getList, getList, getList, getList, getList, getObject, getObject, getObject, getObjects, getSize, getSize, getSort, getSortedList, indexOf, intersects, isEmpty, isSorted, iterator, set, setSort, setSortByName, setSorted, toObjectIds, toString |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String __VERSION
Method Detail |
---|
public final boolean free(LyWorkSpaceListener listener)
listener
- Removed listener.
public void lock()
unlock()
public void unlock()
lock()
public void reset()
reset
in class LyObjectList
public final boolean isDynamic()
isDynamic
in class LyObjectList
public final boolean isLocal()
public final LyDataSession getSession()
getSession
in interface LyGetSessionInterface
public LyWorkSpaceListener getListener(int index)
public int getListenerCount()
public void addListener(LyWorkSpaceListener listener)
listener
- Listener to register.IllegalStateException
- If this workspace is not dynamic.IllegalArgumentException
- If the given listener is null.public void removeListener(LyWorkSpaceListener listener)
listener
- Listener to unregister.IllegalStateException
- If this workspace is not dynamic or if the given listener is
not registered as listener of this workspace.IllegalArgumentException
- If the given listener is null.public void addList(LyObjectList list)
It's overriden from LyObjectList to throw an exception if this workspace is dynamic since we won't known how to recompute it anymore.
addList
in class LyObjectList
objectList
- Objects to add to this list.
java.lang.IllegalStateException
- If this workspace is dynamic.public boolean objectCreated(LyDataSourceEvent event)
objectCreated
in interface LyDataSourceListener
event
- Event notifying the creation of an object.
public boolean objectDeleted(LyDataSourceEvent event)
objectDeleted
in interface LyDataSourceListener
event
- Event notifying the deletion of an object.
public boolean objectModified(LyDataSourceEvent event)
objectModified
in interface LyDataSourceListener
event
- Event notifying the modification of an object.
public boolean objectStateChanged(LyAdvancedDataSourceEvent event)
objectStateChanged
in interface LyAdvancedDataSourceListener
event
- Event notifying object state change.
public boolean objectUserEvent(LyAdvancedDataSourceEvent event)
objectUserEvent
in interface LyAdvancedDataSourceListener
event
- Event notifying the user event of an object.
public boolean dataSourceEventsGrouped(java.util.ArrayList<LyDataSourceEvent> events)
dataSourceEventsGrouped
in interface LyAdvancedDataSourceListener
events
- Sorted list of events.
public LySimpleObjectList getSources(LyObject target)
target
- Target object
|
(c) January 2013 - W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |