org.millstone.base.data
Interface Container.Indexed

All Superinterfaces:
Container, Container.Ordered
All Known Implementing Classes:
IndexedContainer
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 inherited from class org.millstone.base.data.Container
Container.Editor, Container.Hierarchical, Container.Indexed, Container.ItemSetChangeEvent, Container.ItemSetChangeListener, Container.ItemSetChangeNotifier, Container.Ordered, Container.PropertySetChangeEvent, Container.PropertySetChangeListener, Container.PropertySetChangeNotifier, Container.Viewer
 
Field Summary
 
Fields inherited from interface org.millstone.base.data.Container
NULL_ITEM_ID
 
Method Summary
 java.lang.Object addItemAt(int index)
          Add new item at given index.
 Item addItemAt(int index, java.lang.Object newItemId)
          Add new item at given index.
 java.lang.Object getIdByIndex(int index)
          Get the ID of an Item by an index number.
 int indexOfId(java.lang.Object itemId)
          Gets the index of the Item corresponding to itemId.
 
Methods inherited from interface org.millstone.base.data.Container.Ordered
addItemAfter, addItemAfter, firstItemId, isFirstId, isLastId, lastItemId, nextItemId, prevItemId
 
Methods inherited from interface org.millstone.base.data.Container
addContainerProperty, addItem, addItem, containsId, getContainerProperty, getContainerPropertyIds, getItem, getItemIds, getType, removeAllItems, removeContainerProperty, removeItem, size
 

Method Detail

indexOfId

public int indexOfId(java.lang.Object itemId)
Gets the index of the Item corresponding to 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

public java.lang.Object getIdByIndex(int index)
Get the ID of an Item by an index number. The following is true for the index: 0 <= index < size().

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

addItemAt

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

addItemAt

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


Copyright © 2000,2001,2002 IT Mill Ltd. All Rights Reserved.