T - the type of objectspublic class CmsIdentifiableObjectContainer<T> extends java.lang.Object
It can handle relative or absolute orderings and unique names.
| Constructor and Description |
|---|
CmsIdentifiableObjectContainer(boolean uniqueIds,
boolean relativeOrdered)
Default Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addIdentifiableObject(java.lang.String id,
T idObject)
Appends the specified object to the end of this container.
|
void |
addIdentifiableObject(java.lang.String id,
T idObject,
float position)
Inserts the specified object at the specified position in this container.
|
void |
clear()
Resets the container.
|
java.util.List<T> |
elementList()
Returns the list of objects.
|
T |
getObject(java.lang.String id)
Returns the object with the given id.
|
java.util.List<T> |
getObjectList(java.lang.String id)
Returns the list of objects with the given id.
|
void |
removeObject(java.lang.String id)
Removes an object with the given id.
|
public CmsIdentifiableObjectContainer(boolean uniqueIds, boolean relativeOrdered)
uniqueIds - if the list show check for unique idsrelativeOrdered - if the list show use relative ordering, instead of absolute orderingpublic void addIdentifiableObject(java.lang.String id, T idObject)
id - the object identifieridObject - the object add to the containerList.add(Object)public void addIdentifiableObject(java.lang.String id, T idObject, float position)
Shifts the object currently at that position (if any) and any subsequent objects to the right (adds one to their indices).
id - the object identifieridObject - the object add to the containerposition - the insertion pointList.add(int, Object)public void clear()
public java.util.List<T> elementList()
Objects.public T getObject(java.lang.String id)
If uniqueIds is set to false an
containing a Object with all the objects with the given id is returned.List
If the container no contains any object with the given id, null is returned.
id - the id of the objectnullMap.get(Object)public java.util.List<T> getObjectList(java.lang.String id)
id - the object idnullpublic void removeObject(java.lang.String id)
if m_uniqueIds is set, it will remove at most one object.
otherwise it will remove all elements with the given id.
id - the id of the object to remove