|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.millstone.base.data.util.IndexedContainer
A list implementation of the org.millstone.base.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.
Container| 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 |
| Constructor Summary | |
IndexedContainer()
|
|
| Method Summary | |
boolean |
addContainerProperty(java.lang.Object propertyId,
java.lang.Class type,
java.lang.Object defaultValue)
Add a new Property to all Items in the list. |
java.lang.Object |
addItem()
Create a new Item into the list, and assign it an automatic ID. |
Item |
addItem(java.lang.Object itemId)
Create a new Item with the given ID into the list. |
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 |
addItemAt(int index)
Add new item at given index. |
Item |
addItemAt(int index,
java.lang.Object newItemId)
Add new item at given index. |
void |
addListener(Container.ItemSetChangeListener listener)
Adds a Item set change listener for the list. |
void |
addListener(Container.PropertySetChangeListener listener)
Registers a new Property set change listener for this list. |
void |
addListener(Property.ValueChangeListener listener)
Registers a new value change listener for this object. |
boolean |
containsId(java.lang.Object itemId)
Tests if the list contains the specified Item |
java.lang.Object |
firstItemId()
Gets the ID of the first Item in the list. |
Property |
getContainerProperty(java.lang.Object itemId,
java.lang.Object propertyId)
Gets the Property identified by the given Item ID and Property ID from the lsit. |
java.util.Collection |
getContainerPropertyIds()
Gets the ID's of all Properties stored in the list. |
java.lang.Object |
getIdByIndex(int index)
Get ID with the index. |
Item |
getItem(java.lang.Object itemId)
Gets the Item with the given Item ID from the list. |
java.util.Collection |
getItemIds()
Gets the ID's of all Items stored in the list. |
java.lang.Class |
getType(java.lang.Object propertyId)
Gets the type of a Property stored in the list. |
int |
indexOfId(java.lang.Object itemId)
Get the index of an id. |
boolean |
isFirstId(java.lang.Object itemId)
Tests if the Item corresponding to the given Item ID is the first Item in the list. |
boolean |
isLastId(java.lang.Object itemId)
Tests if the Item corresponding to the given Item ID is the last Item in the list. |
java.lang.Object |
lastItemId()
Gets the ID of the last Item in the list. |
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. |
boolean |
removeAllItems()
Remove all Items from the list. |
boolean |
removeContainerProperty(java.lang.Object propertyId)
Remove a Property specified by the given Property ID from the list. |
boolean |
removeItem(java.lang.Object itemId)
Remove the Item corresponding to the given Item ID from the list. |
void |
removeListener(Container.ItemSetChangeListener listener)
Removes a Item set change listener from the object. |
void |
removeListener(Container.PropertySetChangeListener listener)
Removes a previously registered Property set change listener. |
void |
removeListener(Property.ValueChangeListener listener)
Removes a previously registered value change listener. |
int |
size()
Gets the number of Items in the list. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public IndexedContainer()
| Method Detail |
public Item getItem(java.lang.Object itemId)
null is returned.
getItem in interface ContaineritemId - ID of the Item to retrieve
null if the Item
is not found in the listpublic java.util.Collection getItemIds()
getItemIds in interface Containerpublic java.util.Collection getContainerPropertyIds()
getContainerPropertyIds in interface Containerpublic java.lang.Class getType(java.lang.Object propertyId)
getType in interface ContainerpropertyId - ID identifying the Properties
public Property getContainerProperty(java.lang.Object itemId,
java.lang.Object propertyId)
null is returned.
getContainerProperty in interface ContaineritemId - ID of the Item which contains the requested PropertypropertyId - ID of the Property to retrieve
nullContainer.getContainerProperty(Object, Object)public int size()
size in interface Containerpublic boolean containsId(java.lang.Object itemId)
containsId in interface ContaineritemId - ID the of Item to be tested for
true if the operation succeeded,
false if not
public boolean addContainerProperty(java.lang.Object propertyId,
java.lang.Class type,
java.lang.Object defaultValue)
addContainerProperty in interface ContainerpropertyId - ID of the new Propertytype - Data type of the new PropertydefaultValue - The value all created Properties are
initialized to
true if the operation succeeded,
false if notpublic boolean removeAllItems()
removeAllItems in interface Containertrue if the operation succeeded,
false if notpublic java.lang.Object addItem()
null if the operation fails.
After a successful call you can use the
getItem method to
fetch the Item.
addItem in interface Containernull in
case of a failurepublic Item addItem(java.lang.Object itemId)
null if the operation fails or the Container already
contains a Item with the given ID.
addItem in interface ContaineritemId - ID of the Item to be created
null in case of a failurepublic boolean removeItem(java.lang.Object itemId)
removeItem in interface ContaineritemId - ID of the Item to remove
true if the operation succeeded,
false if notpublic boolean removeContainerProperty(java.lang.Object propertyId)
removeContainerProperty in interface ContainerpropertyId - ID of the Property to remove
true if the operation succeeded,
false if notpublic java.lang.Object firstItemId()
firstItemId in interface Container.Orderedpublic java.lang.Object lastItemId()
lastItemId in interface Container.Orderedpublic java.lang.Object nextItemId(java.lang.Object itemId)
itemId. If the given Item is the last or not found
in the list, null is returned.
nextItemId in interface Container.OrdereditemId - ID of an Item in the list
nullpublic java.lang.Object prevItemId(java.lang.Object itemId)
itemId. If the given Item is the first or not found
in the list, null is returned.
prevItemId in interface Container.OrdereditemId - ID of an Item in the list
nullpublic boolean isFirstId(java.lang.Object itemId)
isFirstId in interface Container.OrdereditemId - ID of an Item in the list
true if the Item is first in the list,
false if notpublic boolean isLastId(java.lang.Object itemId)
isLastId in interface Container.OrdereditemId - ID of an Item in the list
true if the Item is last in the list,
false if not
public Item addItemAfter(java.lang.Object previousItemId,
java.lang.Object newItemId)
Container.OrderedAdding an item after null item adds the item as first item of the ordered container.
addItemAfter in interface Container.OrderedpreviousItemId - Id of the previous item in ordered container.newItemId - Id of the new item to be added.
Container.Ordered.addItemAfter(Object, Object)public java.lang.Object addItemAfter(java.lang.Object previousItemId)
Container.OrderedAdding an item after null item adds the item as first item of the ordered container.
addItemAfter in interface Container.OrderedpreviousItemId - Id of the previous item in ordered container.
Container.Ordered.addItemAfter(Object)public java.lang.Object getIdByIndex(int index)
getIdByIndex in interface Container.Indexedindex - Index of the requested ID in the container.
public int indexOfId(java.lang.Object itemId)
indexOfId in interface Container.IndexeditemId - ID of an Item in the collection
public Item addItemAt(int index,
java.lang.Object newItemId)
Container.IndexedThe indexes of the item currently in the given position and all the following items are incremented.
addItemAt in interface Container.Indexedindex - Index to add the new item.newItemId - Id of the new item to be added.
Container.Indexed.addItemAt(int, Object)public java.lang.Object addItemAt(int index)
Container.IndexedThe indexes of the item currently in the given position and all the following items are incremented.
addItemAt in interface Container.Indexedindex - Index to add the new item.
Container.Indexed.addItemAt(int)public void addListener(Container.PropertySetChangeListener listener)
addListener in interface Container.PropertySetChangeNotifierlistener - the new Listener to be registeredpublic void removeListener(Container.PropertySetChangeListener listener)
removeListener in interface Container.PropertySetChangeNotifierlistener - listener to be removedpublic void addListener(Container.ItemSetChangeListener listener)
addListener in interface Container.ItemSetChangeNotifierlistener - listener to be addedpublic void removeListener(Container.ItemSetChangeListener listener)
removeListener in interface Container.ItemSetChangeNotifierlistener - listener to be removedpublic void addListener(Property.ValueChangeListener listener)
addListener in interface Property.ValueChangeNotifierlistener - the new Listener to be registeredpublic void removeListener(Property.ValueChangeListener listener)
removeListener in interface Property.ValueChangeNotifierlistener - listener to be removed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||