org.millstone.base.data
Interface Container.Ordered

All Superinterfaces:
Container
All Known Subinterfaces:
Container.Indexed
All Known Implementing Classes:
ContainerOrderedWrapper, IndexedContainer
Enclosing interface:
Container

public static interface Container.Ordered
extends Container

Interface for Container classes whose Items can be traversed in order.


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 addItemAfter(java.lang.Object previousItemId)
          Add new item after the given item.
 Item addItemAfter(java.lang.Object previousItemId, java.lang.Object newItemId)
          Add new item after the given item.
 java.lang.Object firstItemId()
          Gets the ID of the first Item in the Container.
 boolean isFirstId(java.lang.Object itemId)
          Tests if the Item corresponding to the given Item ID is the first Item in the Container.
 boolean isLastId(java.lang.Object itemId)
          Tests if the Item corresponding to the given Item ID is the last Item in the Container.
 java.lang.Object lastItemId()
          Gets the ID of the last Item in the Container..
 java.lang.Object nextItemId(java.lang.Object itemId)
          Gets the ID of the Item following the Item that corresponds to itemId.
 java.lang.Object prevItemId(java.lang.Object itemId)
          Gets the ID of the Item preceding the Item that corresponds to itemId.
 
Methods inherited from interface org.millstone.base.data.Container
addContainerProperty, addItem, addItem, containsId, getContainerProperty, getContainerPropertyIds, getItem, getItemIds, getType, removeAllItems, removeContainerProperty, removeItem, size
 

Method Detail

nextItemId

public java.lang.Object nextItemId(java.lang.Object itemId)
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 Container, null is returned.

Parameters:
itemId - ID of an Item in the Container
Returns:
ID of the next Item or null

prevItemId

public java.lang.Object prevItemId(java.lang.Object itemId)
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 Container, null is returned.

Parameters:
itemId - ID of an Item in the Container
Returns:
ID of the previous Item or null

firstItemId

public java.lang.Object firstItemId()
Gets the ID of the first Item in the Container.

Returns:
ID of the first Item in the Container

lastItemId

public java.lang.Object lastItemId()
Gets the ID of the last Item in the Container..

Returns:
ID of the last Item in the Container

isFirstId

public boolean isFirstId(java.lang.Object itemId)
Tests if the Item corresponding to the given Item ID is the first Item in the Container.

Parameters:
itemId - ID of an Item in the Container
Returns:
true if the Item is first in the Container, false if not

isLastId

public boolean isLastId(java.lang.Object itemId)
Tests if the Item corresponding to the given Item ID is the last Item in the Container.

Returns:
true if the Item is last in the Container, false if not

addItemAfter

public java.lang.Object addItemAfter(java.lang.Object previousItemId)
                              throws java.lang.UnsupportedOperationException
Add new item after the given item.

Adding an item after null item adds the item as first item of the ordered container.

Parameters:
previousItemId - Id of the previous item in ordered container.
Returns:
Returns item id the the created new item or null if the operation fails.
java.lang.UnsupportedOperationException

addItemAfter

public Item addItemAfter(java.lang.Object previousItemId,
                         java.lang.Object newItemId)
                  throws java.lang.UnsupportedOperationException
Add new item after the given item.

Adding an item after null item adds the item as first item of the ordered container.

Parameters:
previousItemId - Id of the previous item in ordered container.
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.