LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.data
Class LyObjectList

java.lang.Object
  extended by leon.data.LyObjectList
Direct Known Subclasses:
LySimpleObjectList, LyWorkSpace

public abstract class LyObjectList
extends java.lang.Object

This class implements a list of logical objects (LyObject).

This list can be sorted by a specified sort. If this sort is null or not enough discriminating, a default sort is used to be sure that we have a full order (sorting the list several times will always produce the same result). The default sort can be done either on objects names or on objects ids.

It is also possible to turn these lists to not sorted.

Objects list can be dynamic (see classes that extend LyWorkSpace). This means that modifications made on the content of the list can be notified to registered listeners.

See Also:
LyObject

Field Summary
static java.lang.String __VERSION
          File version
 
Method Summary
 void addList(LyObjectList objectList)
          Adds objects of the specified list to this list.
 boolean contains(LyObject object)
          Test if the specified object is contained in this list.
 void delete()
          Methods for deleting all objects of this list.
 void delete(boolean local, boolean refresh)
          Methods for deleting all objects of this list.
 boolean equals(LyObjectList targetList)
          Compare the content of the object lists Object lists are equals if they have exactlky the same LyObjects Sorting is *NOT* taken into account.
 boolean equals(java.lang.Object targetList)
          Compare the content of the object lists Object lists are equals if they have exactlky the same LyObjects Sorting is *NOT* taken into account.
abstract  LyInfoList<LyClassInfo> getClasses()
          Return the list of all class infos to which objects of this list belong.
 int getIndex(LyObject object)
          Returns the position of the specified object.
 LyObjectList getIntersection(LyObjectList list)
          Gets intersection of this list with the given list.
 LyObjectList getList(LyDataSession session, LyClassInfo targetClass)
          Calculate cross references.
 LyObjectList getList(LyDataSession session, LyClassInfo targetClass, boolean dynamic)
          Calculate cross references.
 LyObjectList getList(LyDataSession session, LyClassInfo targetClass, boolean dynamic, boolean local)
          Calculate cross references.
 LyObjectList getList(LyDataSession session, LyClassInfo targetClass, LyFilter filter)
          Calculate cross references.
 LyObjectList getList(LyDataSession session, LyClassInfo targetClass, LyFilter filter, boolean local)
          Calculate cross references.
 LyObjectList getList(LyDataSession session, LyClassInfo targetClass, LyFilter filter, boolean dynamic, boolean local)
          Calculate cross references.
 LyObjectList getList(LyDataSession session, LyClassInfo sourceClass, LyInfoList<? extends LyRoute> routes, boolean dynamic)
          Gets an objects list containing objects accessed through the given routes from objects of this list that belong to the specified source class.
 LyObjectList getList(LyDataSession session, LyClassInfo sourceClass, LyInfoList<? extends LyRoute> routes, boolean dynamic, boolean local)
          Gets an objects list containing objects accessed through the given routes from objects of this list that belong to the specified source class.
 LyObjectList getList(LyDataSession session, LyClassInfo sourceClass, LyRoute route, boolean dynamic)
          Gets an objects list containing objects accessed through the given route from objects of this list that belong to the specified source class.
 LyObjectList getList(LyDataSession session, LyClassInfo sourceClass, LyRoute route, boolean dynamic, boolean local)
          Gets an objects list containing objects accessed through the given route from objects of this list that belong to the specified source class.
 LyObjectList getList(LyDataSession session, LyClassInfo sourceClass, LyRoute route, boolean dynamic, boolean local, boolean recurse)
          Gets an objects list containing objects accessed through the given route from objects of this list that belong to the specified source class.
 LyObjectList getList(LyDataSession session, LyClassInfo sourceClass, java.lang.String routeId, boolean dynamic)
          Gets an objects list containing objects accessed through the route with the given id from objects of this list that belong to the specified source class.
 LyObject getObject(int index)
          Returns the object at the specified index.
 LyObject getObject(LyApplication application, java.lang.String id)
          Returns the object with the specified identifier given as a string within the specified application.
 LyObject getObject(LyObjectId objectId)
          Returns the object with the specified identifier.
 java.util.Vector<LyObject> getObjects()
          Return a vector of objects contained in this list.
 int getSize()
          Returns the number of objects contained in this list.
 int getSize(LyClassInfo classInfo)
          Returns the number of objects of the given classInfo contained in this list.
 LySort getSort()
          Gets the current sort of this list.
 LyObjectList getSortedList(LyInfoLabel label)
          Gets a new list corresponding to this list sorted by the given label.
 int indexOf(LyObject object)
          Returns the position of the specified object using This method is used instead of getIndex when searched object is changed, because the fields values on which the list is sorted could have been changed.
 boolean intersects(LyObjectList list)
          Checks if the given list intersects with this list, this means at least one object is common to the two lists.
 boolean isDynamic()
          Checks whether this list is dynamic or not.
 boolean isEmpty()
          Checks if the list is empty or not.
 boolean isSorted()
          Checks whether this list is sorted or not.
 java.util.Iterator<LyObject> iterator()
          Returns an implementation of the Iterator interface for this LyObjectList.
 void reset()
          Resets this list.
 void set(LyValueSet values)
          Methods for setting all objects of this list.
 void setSort(LySort sort)
          Sets the current sort of this list.
 void setSortByName(boolean byName)
          Specifies if the defaut sorting is done on objects names or on objects ids.
 void setSorted(boolean sorted)
          Sets boolean indicating if this list has to be sorted or not (even if no explicit sort is specified).
 LyObjectId[] toObjectIds()
          Return an array of object ids contained in this list.
 java.lang.String toString()
          Returns a string representation of this object.
 
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
Method Detail

getObjects

public final java.util.Vector<LyObject> getObjects()
Return a vector of objects contained in this list.

Returns:
Vector containing all objects of this list. This list is a copy of the internal list and can be freely modified.

toObjectIds

public final LyObjectId[] toObjectIds()
Return an array of object ids contained in this list.

Returns:
Array of object ids for objects of this list.

getSort

public LySort getSort()
Gets the current sort of this list.

Returns:
Current sort of this list (may be null if default sorting is used).

isDynamic

public boolean isDynamic()
Checks whether this list is dynamic or not. A dynamic list is a list that notifies changes made on its content.

Returns:
True if this list is dynamic, false if it's not.

isSorted

public boolean isSorted()
Checks whether this list is sorted or not.

Returns:
True if this list is sorted, false if it's not.

setSort

public void setSort(LySort sort)
Sets the current sort of this list. The list is immediatly resorted.

Parameters:
sort - New sort for this list.

setSortByName

public void setSortByName(boolean byName)
Specifies if the defaut sorting is done on objects names or on objects ids. Default sorting if used when comparing two objects with the current sort don't discriminate them (or if it's null), to have a full order of our list.

Parameters:
byName - True if default sorting is done with objects names, false if objects ids are used.

setSorted

public void setSorted(boolean sorted)
Sets boolean indicating if this list has to be sorted or not (even if no explicit sort is specified).

Parameters:
sorted - Boolean specifying if this list has to be sorted or not.

getClasses

public abstract LyInfoList<LyClassInfo> getClasses()
Return the list of all class infos to which objects of this list belong. This method is declared abstract to force sub-classes to give a fast implementation.

Returns:
List of classes to which objects of this list belong.

reset

public void reset()
Resets this list. By default, this method clears all objects of the list.


isEmpty

public boolean isEmpty()
Checks if the list is empty or not.

Returns:
True is the list is empty, false otherwise.

getSize

public int getSize(LyClassInfo classInfo)
Returns the number of objects of the given classInfo contained in this list.

Parameters:
classInfo - Class info for which the number of objects is requested.
Returns:
Number of objects in this list of the given class info.

getSize

public int getSize()
Returns the number of objects contained in this list.

Returns:
Number of objects in this list.

contains

public boolean contains(LyObject object)
Test if the specified object is contained in this list.

Parameters:
object - Checked object.
Returns:
True if the object is in this list, false otherwise.
Throws:
java.lang.IllegalArgumentException - If the given object is null.

getObject

public final LyObject getObject(int index)
Returns the object at the specified index.

Parameters:
idx - Index of the searched object.
Returns:
Object at the given index.
Throws:
java.lang.IndexOutOfBoundsException - If the given index is negative or greater or equal to the number of objects in this list.

getObject

public LyObject getObject(LyObjectId objectId)
Returns the object with the specified identifier.

Parameters:
id - Id of the searched object.
Returns:
Object with the specified identifier if it was found, else null.
Throws:
java.lang.IllegalArgumentException - If the given id is null.

getObject

public LyObject getObject(LyApplication application,
                          java.lang.String id)
Returns the object with the specified identifier given as a string within the specified application.

Parameters:
id - Id of the search object given as a string.
Returns:
Object with the specified identifier if it was found, else null.

indexOf

public int indexOf(LyObject object)
Returns the position of the specified object using This method is used instead of getIndex when searched object is changed, because the fields values on which the list is sorted could have been changed.

Parameters:
object - Object searched in this list.
Returns:
Index of the object in this list if it was found, -1 if it was not found.
Throws:
java.lang.IllegalArgumentException - If the given object is null.
See Also:
getIndex

getIndex

public int getIndex(LyObject object)
Returns the position of the specified object.

Parameters:
object - Object searched in this list.
Returns:
Index of the object in this list if it was found, -1 if it was not found.
Throws:
java.lang.IllegalArgumentException - If the given object is null.
See Also:
indexOf

addList

public void addList(LyObjectList objectList)
Adds objects of the specified list to this list.

Parameters:
objectList - Objects to add to this list.

getIntersection

public LyObjectList getIntersection(LyObjectList list)
Gets intersection of this list with the given list.

Parameters:
list - List intersected with this list.
Returns:
IllegalArgumentException If the given list is null.

intersects

public boolean intersects(LyObjectList list)
Checks if the given list intersects with this list, this means at least one object is common to the two lists.

Parameters:
list - List tested for intersection with this list.
Returns:
True if at least one object of the given list is present in this list, false otherwise.

getList

public LyObjectList getList(LyDataSession session,
                            LyClassInfo targetClass,
                            boolean dynamic)
Calculate cross references. Gets in the given session, an objects list containing objects of the specified class that are related with objects of this list.

Parameters:
session - Session in which this search is made. This parameter may be null if the request is not dynamic.
targetClass - Target class of objects to retrieve.
dynamic - Specifies if the result list has to be dynamic or not.
Returns:
An objects list containing objects of the specified class that are related with objects of this list in the given session.
Throws:
java.lang.IllegalArgumentException - If target class is null.

getList

public LyObjectList getList(LyDataSession session,
                            LyClassInfo targetClass,
                            boolean dynamic,
                            boolean local)
Calculate cross references. Gets in the given session, an objects list containing objects of the specified class that are related with objects of this list.

Parameters:
session - Session in which this search is made. This parameter may be null if the request is not dynamic.
targetClass - Target class of objects to retrieve.
dynamic - Specifies if the result list has to be dynamic or not.
local - Specifies if the result list has to be local or not.
Returns:
An objects list containing objects of the specified class that are related with objects of this list in the given session.
Throws:
java.lang.IllegalArgumentException - If target class is null.

getList

public final LyObjectList getList(LyDataSession session,
                                  LyClassInfo targetClass,
                                  LyFilter filter)
Calculate cross references. Gets in the given session, an objects list containing objects of the specified class that are related with objects of this list and that pass the given filter.

Parameters:
session - Session in which this search is made. This parameter may be null if the request is not dynamic.
targetClass - Target class of objects to retrieve (may be null).
filter - a filter for the result list (may be null).
Returns:
An objects list containing objects of the specified class that are related with objects of this list in the given session and that pass the given filter.
Throws:
java.lang.IllegalArgumentException - If targetClass and filter are both null.

getList

public final LyObjectList getList(LyDataSession session,
                                  LyClassInfo targetClass,
                                  LyFilter filter,
                                  boolean local)
Calculate cross references. Gets in the given session, an objects list containing objects of the specified class that are related with objects of this list and that pass the given filter.

Parameters:
session - Session in which this search is made. This parameter may be null if the request is not dynamic.
targetClass - Target class of objects to retrieve (may be null).
filter - a filter for the result list (may be null).
local - Specifies if the result list must be local or not.
Returns:
An objects list containing objects of the specified class that are related with objects of this list in the given session and that pass the given filter.
Throws:
java.lang.IllegalArgumentException - If targetClass and filter are both null.

getList

public LyObjectList getList(LyDataSession session,
                            LyClassInfo targetClass,
                            LyFilter filter,
                            boolean dynamic,
                            boolean local)
Calculate cross references. Gets in the given session, an objects list containing objects of the specified class that are related with objects of this list and that pass the given filter.

Parameters:
session - Session in which this search is made. This parameter may be null if the request is not dynamic.
targetClass - Target class of objects to retrieve (may be null).
filter - a filter for the result list (may be null).
local - Specifies if the result list must be local or not.
Returns:
An objects list containing objects of the specified class that are related with objects of this list in the given session and that pass the given filter.
Throws:
java.lang.IllegalArgumentException - If targetClass and filter are both null.

getList

public final LyObjectList getList(LyDataSession session,
                                  LyClassInfo targetClass)
Calculate cross references. Gets in the given session, an objects list containing objects of the specified class that are related with objects of this list.

Parameters:
session - Session in which this search is made.
targetClass - Target class of objects to retrieve.
Returns:
An objects list containing objects of the specified class that are related with objects of this list in the given session.
Throws:
java.lang.IllegalArgumentException - If target class is null.

getList

public LyObjectList getList(LyDataSession session,
                            LyClassInfo sourceClass,
                            java.lang.String routeId,
                            boolean dynamic)
Gets an objects list containing objects accessed through the route with the given id from objects of this list that belong to the specified source class.

Parameters:
session - Session in which this search is made.
sourceClass - Source class for objects of this list. This may restrict objects of this list that are used to calculate the result list.
routeId - Identifier of the route used to reach taraget objects.
dynamic - Specifies if the result list has to be dynamic or not.
Throws:
java.lang.IllegalArgumentException - If no route with the given id is found on the source class.

getList

public final LyObjectList getList(LyDataSession session,
                                  LyClassInfo sourceClass,
                                  LyInfoList<? extends LyRoute> routes,
                                  boolean dynamic)
Gets an objects list containing objects accessed through the given routes from objects of this list that belong to the specified source class.

Parameters:
session - Session in which this search is made.
sourceClass - Source class.
routes - List of routes used to reach target objects.
dynamic - Specifies if the result list has to be dynamic or not.
Throws:
java.lang.IllegalArgumentException - If the given list of routes is null or empty.

getList

public LyObjectList getList(LyDataSession session,
                            LyClassInfo sourceClass,
                            LyInfoList<? extends LyRoute> routes,
                            boolean dynamic,
                            boolean local)
Gets an objects list containing objects accessed through the given routes from objects of this list that belong to the specified source class.

Parameters:
session - Session in which this search is made.
sourceClass - Source class.
routes - List of routes used to reach target objects.
dynamic - Specifies if the result list has to be dynamic or not.
local - Specifies if the result list has to be local or not.
Throws:
java.lang.IllegalArgumentException - If the given list of routes is null or empty.

getList

public final LyObjectList getList(LyDataSession session,
                                  LyClassInfo sourceClass,
                                  LyRoute route,
                                  boolean dynamic)
Gets an objects list containing objects accessed through the given route from objects of this list that belong to the specified source class.

Parameters:
session - Session in which this search is made.
sourceClass - Source class for objects of this list.
route - Route used to reach target objects.
dynamic - Specifies if the result list has to be dynamic or not.

getList

public final LyObjectList getList(LyDataSession session,
                                  LyClassInfo sourceClass,
                                  LyRoute route,
                                  boolean dynamic,
                                  boolean local)
Gets an objects list containing objects accessed through the given route from objects of this list that belong to the specified source class.

Parameters:
session - Session in which this search is made.
sourceClass - Source class for objects of this list.
route - Route used to reach target objects.
dynamic - Specifies if the result list has to be dynamic or not.
local - Specifies if the result list has to be local or not.

getList

public LyObjectList getList(LyDataSession session,
                            LyClassInfo sourceClass,
                            LyRoute route,
                            boolean dynamic,
                            boolean local,
                            boolean recurse)
Gets an objects list containing objects accessed through the given route from objects of this list that belong to the specified source class.

Parameters:
session - Session in which this search is made.
sourceClass - Source class for objects of this list.
route - Route used to reach target objects.
dynamic - Specifies if the result list has to be dynamic or not.
local - Specifies if the result list has to be local or not.
recurse - Activates recursion when sourceClass and targetClass are identical.

set

public void set(LyValueSet values)
Methods for setting all objects of this list. Calls setObjects on each classes of the list.


delete

public void delete()
Methods for deleting all objects of this list. Calls deleteObjects on each classes of the list.


delete

public void delete(boolean local,
                   boolean refresh)
Methods for deleting all objects of this list. Calls deleteObjects on each classes of the list.

Parameters:
local - Indicates if deletions must be local or not
refresh - Indicates if the deletions may be notified or not.

equals

public boolean equals(java.lang.Object targetList)
Compare the content of the object lists Object lists are equals if they have exactlky the same LyObjects Sorting is *NOT* taken into account.

Overrides:
equals in class java.lang.Object
Returns:
true if the set of contained objects is identical.

equals

public boolean equals(LyObjectList targetList)
Compare the content of the object lists Object lists are equals if they have exactlky the same LyObjects Sorting is *NOT* taken into account.

Returns:
true if the set of contained objects is identical.

toString

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

Overrides:
toString in class java.lang.Object
Returns:
This objects list returned as a string.

getSortedList

public LyObjectList getSortedList(LyInfoLabel label)
Gets a new list corresponding to this list sorted by the given label.

Parameters:
label - Label used to sort this list.
Returns:
The new list sorted by the given label.

iterator

public java.util.Iterator<LyObject> iterator()
Returns an implementation of the Iterator interface for this LyObjectList.


(c) January 2013 - W4 S.A.

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