Indexed container implementation.
A list implementation of the com.itmill.toolkit.data.Container interface. A list is a ordered collection wherein the user has a precise control over where in the list each new Item is inserted. The user may access the Items by their integer index (position in the list) or by their Item ID.
com.itmill.toolkit.data.Container
3.0
Inheritance Path. java.lang.Object-> com.itmill.toolkit.data.util.IndexedContainer
Parameters
propertyId
ID of the new Property
type
Data type of the new Property
defaultValue
The value all created Properties are initialized to
true
if the operation succeeded,
false
if not
Add a new Property to all Items in the list. The Property ID, data type and default value of the new Property are given as parameters.
Parameters
ID of the newly created Item, or
null
in case of a
failure
Create a new Item into the list, and assign it an automatic ID. The new
ID is returned, or
null
if the operation fails. After a
successful call you can use the <javadoc:link ref="METHOD-52-1" name="
getItem
">
getItem
method to fetch the
Item.
Parameters
itemId
ID of the Item to be created
Created new Item, or
null
in case of a failure
Create a new Item with the given ID into the list. The new Item is
returned, and it is ready to have its Properties modified. Returns
null
if the operation fails or the Container already
contains a Item with the given ID.
addItemAfter(java.lang.Object)
Parameters
index
Index to add the new item.
Returns item id the the created new item or null if the operation fails.
addItemAt(int)
Add new item at given index.
The indexes of the item currently in the given position and all the following items are incremented.
Parameters
index
Index to add the new item.
newItemId
Id of the new item to be added.
Returns new item or null if the operation fails.
addItemAt(int, java.lang.Object)
Add new item at given index.
The indexes of the item currently in the given position and all the following items are incremented.
Parameters
listener
listener to be added
Adds a Item set change listener for the list.
Parameters
listener
the new Listener to be registered
Registers a new Property set change listener for this list.
Parameters
listener
the new Listener to be registered
Registers a new value change listener for this object.
Compare two items for sorting.
Parameters
itemId
ID the of Item to be tested for
true
if the operation succeeded,
false
if not
Tests if the list contains the specified Item
Parameters
ID of the first Item in the list
Gets the ID of the first Item in the list.
Parameters
itemId
ID of the Item which contains the requested Property
propertyId
ID of the Property to retrieve
Property with the given ID or
null
Gets the Property identified by the given Item ID and Property ID from
the lsit. If the list does not contain the Property,
null
is returned.
Parameters
unmodifiable collection of Property IDs
Gets the ID's of all Properties stored in the list. The ID's are returned as a unmodifiable collection.
Parameters
index
Index of the requested ID in the container.
ID in the given index.
Get ID with the index. The following is true for the index: 0 <= index < size().
Parameters
itemId
ID of the Item to retrieve
the Item with the given ID or
null
if the Item is
not found in the list
Gets the Item with the given Item ID from the list. If the list does not
contain the requested Item,
null
is returned.
Parameters
unmodifiable collection of Item IDs
Gets the ID's of all Items stored in the list. The ID's are returned as a unmodifiable collection.
Parameters
The sortable field ids.
Get the container property IDs, which can be used to sort the item.
Parameters
id
ID of the Property
Type of the requested Property
Gets the type of a Property stored in the list.
Parameters
itemId
ID of an Item in the collection
Index of the Item or -1 if the Item is not in the container.
Get the index of an id. The following is true for the index: 0 <= index < size().
Parameters
itemId
ID of an Item in the list
true
if the Item is first in the list,
false
if not
Tests if the Item corresponding to the given Item ID is the first Item in the list.
Parameters
itemId
ID of an Item in the list
true
if the Item is last in the list,
false
if not
Tests if the Item corresponding to the given Item ID is the last Item in the list.
Parameters
ID of the last Item in the list
Gets the ID of the last Item in the list.
Parameters
itemId
ID of an Item in the list
ID of the next Item or
null
Gets the ID of the Item following the Item that corresponds to
itemId
. If the given Item is the last or not found in the
list,
null
is returned.
Parameters
itemId
ID of an Item in the list
ID of the previous Item or
null
Gets the ID of the Item preceding the Item that corresponds to
itemId
. If the given Item is the first or not found in
the list,
null
is returned.
Parameters
true
if the operation succeeded,
false
if not
Remove all Items from the list. Note that Property ID and type information is preserved.
Parameters
propertyId
ID of the Property to remove
true
if the operation succeeded,
false
if not
Remove a Property specified by the given Property ID from the list. Note that the Property will be removed from all Items in the list.
Parameters
itemId
ID of the Item to remove
true
if the operation succeeded,
false
if not
Remove the Item corresponding to the given Item ID from the list.
Parameters
listener
listener to be removed
Removes a Item set change listener from the object.
Parameters
listener
listener to be removed
Removes a previously registered Property set change listener.
Parameters
listener
listener to be removed
Removes a previously registered value change listener.
Parameters
propertyId
Array of container property IDs, which values are used to
sort the items in container as primary, secondary, ...
sorting criterion. All of the item IDs must be in the
collection returned by
getSortableContainerPropertyIds()
ascending
Array of sorting order flags corresponding to each property ID
used in sorting. If this array is shorter than propertyId array,
ascending order is assumed for items where the order is not
specified.
Use
true
to sort in ascending order,
false
to use descending order.
Sort method. Sort the container items.