LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.data
Class LyMultiClassWorkSpace

java.lang.Object
  extended by leon.data.LyObjectList
      extended by leon.data.LyWorkSpace
          extended by leon.data.LyMultiClassWorkSpace
All Implemented Interfaces:
LyGetSessionInterface, LyAdvancedDataSourceListener, LyDataSourceListener

public class LyMultiClassWorkSpace
extends LyWorkSpace

This class implements a multi-class workspace : workspace for objects belonging to a given list of classes info and optionnally, matching a filter.

See Also:
LyClassInfo, LyFilter

Field Summary
static java.lang.String __VERSION
          File version
 
Constructor Summary
LyMultiClassWorkSpace(LyDataSession session, LyInfoList<LyClassInfo> classInfos, boolean dynamic)
          Constructs a multi-class workspace within a given session for a list of class infos.
LyMultiClassWorkSpace(LyDataSession session, LyInfoList<LyClassInfo> classInfos, LyFilter filter, boolean dynamic)
          Constructs a multi-class workspace within a given session for a list of class infos with specified filter applied to objects of these classes.
LyMultiClassWorkSpace(LyDataSession session, LyInfoList<LyClassInfo> classInfos, LyFilter filter, LySort sort, boolean dynamic)
          Constructs a multi-class workspace within a given session for a list of class infos with specified filter applied to objects of these classes and sorted by the given sort.
LyMultiClassWorkSpace(LyDataSession session, LyInfoList<LyClassInfo> classInfos, LyFilter filter, LySort sort, boolean dynamic, boolean sorted)
          Internal constructor with all parameters for construction of a multi-class workpace and an additionnal one that indicates if the workspace is loaded or not.
LyMultiClassWorkSpace(LyDataSession session, LyInfoList<LyClassInfo> classInfos, LyFilter filter, LySort sort, boolean dynamic, boolean sorted, boolean local)
          Internal constructor with all parameters for construction of a multi-class workpace and an additionnal one that indicates if the workspace is loaded or not.
 
Method Summary
 LyInfoList<LyClassInfo> getClasses()
          Return the list of all class infos to which objects of this workspace belong.
 LyFilter getFilter()
          Gets the filter of this class workspace.
 boolean objectCreated(LyDataSourceEvent event)
          Method for receiving an object creation.
 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 reset()
          Method for resetting this workspace.
 java.lang.String toString()
          Returns a string representation of this workspace.
 
Methods inherited from class leon.data.LyWorkSpace
addList, addListener, dataSourceEventsGrouped, free, getListener, getListenerCount, getSession, getSources, isDynamic, isLocal, lock, objectDeleted, removeListener, unlock
 
Methods inherited from class leon.data.LyObjectList
contains, delete, delete, equals, equals, 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
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
File version

See Also:
Constant Field Values
Constructor Detail

LyMultiClassWorkSpace

public LyMultiClassWorkSpace(LyDataSession session,
                             LyInfoList<LyClassInfo> classInfos,
                             boolean dynamic)
Constructs a multi-class workspace within a given session for a list of class infos.

Parameters:
session - Session in which the workspace is constructed.
classInfos - List of class infos to which objects of this workspace belong.
dynamic - Specifies if this workspace is dynamic or not.

LyMultiClassWorkSpace

public LyMultiClassWorkSpace(LyDataSession session,
                             LyInfoList<LyClassInfo> classInfos,
                             LyFilter filter,
                             boolean dynamic)
Constructs a multi-class workspace within a given session for a list of class infos with specified filter applied to objects of these classes.

Parameters:
session - Session in which the workspace is constructed.
classInfos - List of class infos to which objects of this workspace belong.
filter - Filter applied to objects for being in this workspace.
dynamic - Specifies if this workspace is dynamic or not.

LyMultiClassWorkSpace

public LyMultiClassWorkSpace(LyDataSession session,
                             LyInfoList<LyClassInfo> classInfos,
                             LyFilter filter,
                             LySort sort,
                             boolean dynamic)
Constructs a multi-class workspace within a given session for a list of class infos with specified filter applied to objects of these classes and sorted by the given sort.

Parameters:
session - Session in which the workspace is constructed.
classInfos - List of class infos to which objects of this workspace belong.
filter - Filter applied to objects for being in this workspace.
sort - Sort requested in this workspace.
dynamic - Specifies if this workspace is dynamic or not.

LyMultiClassWorkSpace

public LyMultiClassWorkSpace(LyDataSession session,
                             LyInfoList<LyClassInfo> classInfos,
                             LyFilter filter,
                             LySort sort,
                             boolean dynamic,
                             boolean sorted)
Internal constructor with all parameters for construction of a multi-class workpace and an additionnal one that indicates if the workspace is loaded or not.

Parameters:
session - Session in which the workspace is constructed.
classInfos - List of class infos to which objects of this workspace belong.
filter - Filter applied to objects for being in this workspace.
sort - Sort requested in this workspace.
dynamic - Specifies if this workspace is dynamic or not.
sorted - Indicates if this workspace must be sorted or not.

LyMultiClassWorkSpace

public LyMultiClassWorkSpace(LyDataSession session,
                             LyInfoList<LyClassInfo> classInfos,
                             LyFilter filter,
                             LySort sort,
                             boolean dynamic,
                             boolean sorted,
                             boolean local)
Internal constructor with all parameters for construction of a multi-class workpace and an additionnal one that indicates if the workspace is loaded or not.

Parameters:
session - Session in which the workspace is constructed.
classInfos - List of class infos to which objects of this workspace belong.
filter - Filter applied to objects for being in this workspace.
sort - Sort requested in this workspace.
dynamic - Specifies if this workspace is dynamic or not.
sorted - Indicates if this workspace must be sorted or not.
local - Specifies if this workspace is local or not.
Method Detail

getClasses

public LyInfoList<LyClassInfo> getClasses()
Return the list of all class infos to which objects of this workspace belong. This method is overriden to optimize it since we known from start to which classes the objects of this workspace belong.

Specified by:
getClasses in class LyObjectList
Returns:
List of classes to which objects of this workspace belong.

getFilter

public LyFilter getFilter()
Gets the filter of this class workspace.

Returns:
Filter specified for this class workspace.

reset

public void reset()
Method for resetting this workspace. Objects contained in this workspace are removed and reloaded from the object sources of the class infos specified for this workspace.

Overrides:
reset in class LyWorkSpace

toString

public java.lang.String toString()
Returns a string representation of this workspace.

Overrides:
toString in class LyObjectList
Returns:
This workspace returned as a string.

objectCreated

public boolean objectCreated(LyDataSourceEvent event)
Method for receiving an object creation. This method is overriden to check if the object matchs the filter specified on this workspace if it has one.

Specified by:
objectCreated in interface LyDataSourceListener
Overrides:
objectCreated in class LyWorkSpace
Parameters:
event - Event notifying the creation of an object.
Returns:
True indicating if the event was used, false otherwise.

objectModified

public boolean objectModified(LyDataSourceEvent event)
Method for receiving an object modification. If the object concerned by the event was not in this workspace, that means it didn't match its filter, so we now check if modifications done change this and in that case, we add the object in the workspace. On the contrary, if the object was in the workspace, we check if the object still matches the filter, and if not, we remove it from this workspace.

Specified by:
objectModified in interface LyDataSourceListener
Overrides:
objectModified in class LyWorkSpace
Parameters:
event - Event notifying the modification of an object.
Returns:
True indicating if the event was used, false otherwise.

objectStateChanged

public boolean objectStateChanged(LyAdvancedDataSourceEvent event)
Called when an object state is changed.

Specified by:
objectStateChanged in interface LyAdvancedDataSourceListener
Overrides:
objectStateChanged in class LyWorkSpace
Parameters:
event - Event notifying object state change.
Returns:
True if the event is used by the listener, false otherwise.

objectUserEvent

public boolean objectUserEvent(LyAdvancedDataSourceEvent event)
Method for receiving user event on an object.

Specified by:
objectUserEvent in interface LyAdvancedDataSourceListener
Overrides:
objectUserEvent in class LyWorkSpace
Parameters:
event - Event notifying the user event of an object.
Returns:
True indicating if the event was used, false otherwise.

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com