Package org.opencms.workplace.tools
Class CmsIdentifiableObjectContainer<T>
java.lang.Object
org.opencms.workplace.tools.CmsIdentifiableObjectContainer<T>
- Type Parameters:
T
- the type of objects
Default implementation of a named object container.
It can handle relative or absolute orderings and unique names.
- Since:
- 6.0.0
-
Constructor Summary
ConstructorDescriptionCmsIdentifiableObjectContainer
(boolean uniqueIds, boolean relativeOrdered) Default Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addIdentifiableObject
(String id, T idObject) Appends the specified object to the end of this container.void
addIdentifiableObject
(String id, T idObject, float position) Inserts the specified object at the specified position in this container.void
clear()
Resets the container.Returns the list of objects.Returns the object with the given id.getObjectList
(String id) Returns the list of objects with the given id.void
removeObject
(String id) Removes an object with the given id.
-
Constructor Details
-
CmsIdentifiableObjectContainer
Default Constructor.- Parameters:
uniqueIds
- if the list show check for unique idsrelativeOrdered
- if the list show use relative ordering, instead of absolute ordering
-
-
Method Details
-
addIdentifiableObject
Appends the specified object to the end of this container.- Parameters:
id
- the object identifieridObject
- the object add to the container- See Also:
-
addIdentifiableObject
Inserts the specified object at the specified position in this container.Shifts the object currently at that position (if any) and any subsequent objects to the right (adds one to their indices).
- Parameters:
id
- the object identifieridObject
- the object add to the containerposition
- the insertion point- See Also:
-
clear
Resets the container. -
elementList
Returns the list of objects.- Returns:
- the a list of
s.Object
-
getObject
Returns the object with the given id.If
uniqueIds
is set tofalse
an
containing aObject
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.- Parameters:
id
- the id of the object- Returns:
- the object if found, or
null
- See Also:
-
getObjectList
Returns the list of objects with the given id.- Parameters:
id
- the object id- Returns:
- the list of objects if found, or
null
-
removeObject
Removes an object with the given id.if
m_uniqueIds
is set, it will remove at most one object. otherwise it will remove all elements with the given id.- Parameters:
id
- the id of the object to remove
-