|
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.info.LyInfoList<Info>
public class LyInfoList<Info extends LyInfo>
This class is an utility class to manage a list of LyInfo. Its only purpose is to avoid duplicate
code between all classes that extend LyInfo.
By default, this list doesn't accept multiple occurrences of the same info, but this mode can be
set on to enable them (this mode can only be chosen at construction).
After construction, these lists are writable, but once turned to unwritable by lock method, they
can't be modified anymore (nor returned to a writable state).
LyInfo
,
LyObjectInfo
Field Summary | |
---|---|
static java.lang.String |
__VERSION
|
Constructor Summary | |
---|---|
LyInfoList()
Default constructor with no parameters. |
|
LyInfoList(boolean multiple)
Constructor with choice of multiple occurrences or not. |
|
LyInfoList(Info info)
Constructs a new list and add the given info to it. |
|
LyInfoList(Info[] infos)
Constructs a new list from an array of infos |
|
LyInfoList(java.util.List<Info> list)
Constructs a new list from a List containing infos. |
|
LyInfoList(LyInfoList<Info> infoList)
Constructs a new list from an existing one. |
Method Summary | ||
---|---|---|
int |
addInfo(Info info)
Adds a new info at the end of this info list. |
|
int |
addInfo(Info info,
int position)
Adds a new info to this info list at the specified position. |
|
void |
addList(java.util.List<Info> list)
Adds all infos of the given list to this list. |
|
void |
addList(LyInfoList<Info> list)
Adds all infos of the given list to this list. |
|
java.lang.Object |
clone()
Returns a clone of this list. |
|
boolean |
contains(Info info)
Checks if the given info is contained in this list. |
|
boolean |
contains(LyInfoList<Info> infos)
Checks if the given list of infos are contained in this list. |
|
boolean |
contains(LyInfoList<Info> infos,
boolean all)
Checks if the given list of infos are contained in this list. |
|
boolean |
equals(java.lang.Object obj)
Compare infolist content. |
|
java.lang.Class<?> |
getComponentType()
|
|
int |
getIndex(Info info)
Get index of a given info. |
|
Info |
getInfo(int index)
Gets info at the specified index. |
|
Info |
getInfo(java.lang.String id)
Fetches the info with the specified identifier or name (only works for stored infos that are instances of LyObjectInfo). |
|
Info |
getInfo(java.lang.String id,
boolean byName)
Fetches the info with the specified identifier or name (only works for stored infos that are instances of LyObjectInfo). |
|
java.util.Vector<Info> |
getInfos()
Returns a vector containing all infos of this list. |
|
LyInfoList<Info> |
getInfos(java.util.BitSet marks)
Shortcut for the previous method with 'matchAll' set to true (infos matching all marks requested). |
|
LyInfoList<Info> |
getInfos(java.util.BitSet marks,
boolean matchAll)
Gets infos that have the given marks (all or one of them). |
|
|
getInfos(java.lang.Class<T> infoClass)
Returns a sub-list of this list of all infos of a given java class. |
|
LyInfoList<Info> |
getInfos(int mark)
Shortcut for the previous method with 'not' set to false (matching required). |
|
LyInfoList<Info> |
getInfos(int mark,
boolean not)
Gets the list of infos that match or that don't match a given mark. |
|
LyInfoList<Info> |
getInfosById()
Returns a list containing all object infos of this list sorted by their id. |
|
LyInfoList<Info> |
getInfosByName()
Returns a list containing all infos of this list sorted by their names. |
|
LyInfoList<Info> |
getInfosByName(LyEnvironment translationEnv)
Returns a list containing all infos of this list sorted by their names. |
|
LyInfoList<Info> |
getObjectInfosByName()
Deprecated. Use getInfosByName(LyEnvironment). |
|
LyInfoList<Info> |
getObjectInfosByName(LyEnvironment translationEnv)
Deprecated. Use getInfosByName(LyEnvironment). |
|
int |
getSize()
Returns the number of infos in this list. |
|
boolean |
isWritable()
Checks writable mode on this list. |
|
void |
lock()
Locks this list (turn it to unwritable). |
|
int |
removeInfo(Info info)
Removes the specified info from this info list. |
|
void |
resetInfos()
Resets info list (remove all infos from this list). |
|
LyInfo[] |
toArray()
Returns an array containing all of the elements in this collection. |
|
java.lang.String |
toString()
Dumps content of this list. |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String __VERSION
Constructor Detail |
---|
public LyInfoList()
public LyInfoList(boolean multiple)
multiple
- Boolean indicating if multiple occurrences are allowed or not.public LyInfoList(LyInfoList<Info> infoList)
infoList
- Copied list.public LyInfoList(java.util.List<Info> list)
list
- Vector from which infos are copied.public LyInfoList(Info[] infos)
infos
- Infos array.public LyInfoList(Info info)
info
- Info added in our new list.Method Detail |
---|
public java.lang.Class<?> getComponentType()
public final boolean isWritable()
public final Info getInfo(java.lang.String id)
id
- Identifier (or name) of the requested info
public final Info getInfo(java.lang.String id, boolean byName)
id
- Identifier or name of the requested info, as specified by the following
parameter.byName
- Boolean indicating if the search is done on id or on name.
public final LyInfoList<Info> getInfos(java.util.BitSet marks, boolean matchAll)
marks
- The requested marksmatchAll
- Indicates if the info must have at least one mark (false) or all of them
(true).
public final LyInfoList<Info> getInfos(java.util.BitSet marks)
marks
- The requested marks.
getInfos(java.util.BitSet, boolean)
public final LyInfoList<Info> getInfos(int mark, boolean not)
mark
- The requested marknot
- To invert the search : the result are the infos that have not the mark.
public final LyInfoList<Info> getInfos(int mark)
mark
- The requested mark.
getInfos(java.util.BitSet, boolean)
public final int getSize()
public final Info getInfo(int index)
index
- Index of the requested info.
java.lang.ArrayIndexOutOfBoundsException
- If index is negative, or greater than or equal to
the number of infos in the list.public final java.util.Vector<Info> getInfos()
public <T extends Info> LyInfoList<T> getInfos(java.lang.Class<T> infoClass)
infoClass
- The java class.
public final LyInfoList<Info> getInfosById()
public final LyInfoList<Info> getObjectInfosByName()
public final LyInfoList<Info> getInfosByName()
public final LyInfoList<Info> getObjectInfosByName(LyEnvironment translationEnv)
public final LyInfoList<Info> getInfosByName(LyEnvironment translationEnv)
translationEnv
- optional environment to translate strings
public final void lock()
public int addInfo(Info info, int position)
info
- Info that should be added.position
- Requested position. A negative index or an index greater than or equal to
the number of infos in this list, means insert at the end of the list.
java.lang.IllegalStateException
- If this list is not writable.public final int addInfo(Info info)
info
- Info that should be added
java.lang.IllegalStateException
- If this list is not writable.public int removeInfo(Info info)
info
- Info to remove.
java.lang.IllegalStateException
- If this list is not writable.public void addList(LyInfoList<Info> list)
list
- List of infos to add to this list.
java.lang.IllegalStateException
- If this list is not writable.public void addList(java.util.List<Info> list)
list
- List of infos to add to this list.
java.lang.IllegalStateException
- If this list is not writable.public void resetInfos()
java.lang.IllegalStateException
- If this list is not writable.public final int getIndex(Info info)
info
- The searched info.
public final boolean contains(Info info)
info
- The searched info.
public final boolean contains(LyInfoList<Info> infos)
infos
- the searched list of infos.
public final boolean contains(LyInfoList<Info> infos, boolean all)
infos
- the searched list of infos.
public java.lang.Object clone()
clone
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- another list to compare contentpublic java.lang.String toString()
toString
in class java.lang.Object
public LyInfo[] toArray()
|
(c) January 2013 - W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |