com.itmill.toolkit.data
Interface Container.Indexed

All Superinterfaces:
Container, Container.Ordered
All Known Implementing Classes:
HierarchicalContainer, IndexedContainer, QueryContainer
Enclosing interface:
Container

public static interface Container.Indexed
extends Container.Ordered

Interface for Container classes whose Items can be indexed.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.itmill.toolkit.data.Container
Container.Editor, Container.Filterable, Container.Hierarchical, Container.Indexed, Container.ItemSetChangeEvent, Container.ItemSetChangeListener, Container.ItemSetChangeNotifier, Container.Ordered, Container.PropertySetChangeEvent, Container.PropertySetChangeListener, Container.PropertySetChangeNotifier, Container.Sortable, Container.Viewer
 
Method Summary
 Object addItemAt(int index)
          Adds new item at given index.
 Item addItemAt(int index, Object newItemId)
          Adds new item at given index.
 Object getIdByIndex(int index)
          Gets the ID of an Item by an index number.
 int indexOfId(Object itemId)
          Gets the index of the Item corresponding to the itemId.
 
Methods inherited from interface com.itmill.toolkit.data.Container.Ordered
addItemAfter, addItemAfter, firstItemId, isFirstId, isLastId, lastItemId, nextItemId, prevItemId
 
Methods inherited from interface com.itmill.toolkit.data.Container
addContainerProperty, addItem, addItem, containsId, getContainerProperty, getContainerPropertyIds, getItem, getItemIds, getType, removeAllItems, removeContainerProperty, removeItem, size
 

Method Detail

indexOfId

int indexOfId(Object itemId)
Gets the index of the Item corresponding to the itemId. The following is true for the returned index: 0 <= index < size().

Parameters:
itemId - ID of an Item in the Container
Returns:
index of the Item, or -1 if the Container does not include the Item

getIdByIndex

Object getIdByIndex(int index)
Gets the ID of an Item by an index number.

Parameters:
index - Index of the requested id in the Container
Returns:
ID of the Item in the given index

addItemAt

Object addItemAt(int index)
                 throws UnsupportedOperationException
Adds 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.
Returns:
Returns item id the the created new item or null if the operation fails.
Throws:
UnsupportedOperationException

addItemAt

Item addItemAt(int index,
               Object newItemId)
               throws UnsupportedOperationException
Adds 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:
Returns new item or null if the operation fails.
Throws:
UnsupportedOperationException


Copyright © 2000-2009 IT Mill Ltd. All Rights Reserved.