|
||||||||||
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 Container
itemId
- ID of the Item to retrieve
null
if the Item
is not found in the listpublic java.util.Collection getItemIds()
getItemIds
in interface Container
public java.util.Collection getContainerPropertyIds()
getContainerPropertyIds
in interface Container
public java.lang.Class getType(java.lang.Object propertyId)
getType
in interface Container
propertyId
- ID identifying the Properties
public Property getContainerProperty(java.lang.Object itemId, java.lang.Object propertyId)
null
is returned.
getContainerProperty
in interface Container
itemId
- ID of the Item which contains the requested PropertypropertyId
- ID of the Property to retrieve
null
Container.getContainerProperty(Object, Object)
public int size()
size
in interface Container
public boolean containsId(java.lang.Object itemId)
containsId
in interface Container
itemId
- ID the of Item to be tested for
true
if the operation succeeded,
false
if notpublic boolean addContainerProperty(java.lang.Object propertyId, java.lang.Class type, java.lang.Object defaultValue)
addContainerProperty
in interface Container
propertyId
- 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 Container
true
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 Container
null
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 Container
itemId
- ID of the Item to be created
null
in case of a failurepublic boolean removeItem(java.lang.Object itemId)
removeItem
in interface Container
itemId
- ID of the Item to remove
true
if the operation succeeded,
false
if notpublic boolean removeContainerProperty(java.lang.Object propertyId)
removeContainerProperty
in interface Container
propertyId
- ID of the Property to remove
true
if the operation succeeded,
false
if notpublic java.lang.Object firstItemId()
firstItemId
in interface Container.Ordered
public java.lang.Object lastItemId()
lastItemId
in interface Container.Ordered
public 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.Ordered
itemId
- ID of an Item in the list
null
public 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.Ordered
itemId
- ID of an Item in the list
null
public boolean isFirstId(java.lang.Object itemId)
isFirstId
in interface Container.Ordered
itemId
- 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.Ordered
itemId
- ID of an Item in the list
true
if the Item is last in the list,
false
if notpublic Item addItemAfter(java.lang.Object previousItemId, java.lang.Object newItemId)
Container.Ordered
Adding an item after null item adds the item as first item of the ordered container.
addItemAfter
in interface Container.Ordered
previousItemId
- 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.Ordered
Adding an item after null item adds the item as first item of the ordered container.
addItemAfter
in interface Container.Ordered
previousItemId
- Id of the previous item in ordered container.
Container.Ordered.addItemAfter(Object)
public java.lang.Object getIdByIndex(int index)
getIdByIndex
in interface Container.Indexed
index
- Index of the requested ID in the container.
public int indexOfId(java.lang.Object itemId)
indexOfId
in interface Container.Indexed
itemId
- ID of an Item in the collection
public Item addItemAt(int index, java.lang.Object newItemId)
Container.Indexed
The indexes of the item currently in the given position and all the following items are incremented.
addItemAt
in interface Container.Indexed
index
- 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.Indexed
The indexes of the item currently in the given position and all the following items are incremented.
addItemAt
in interface Container.Indexed
index
- Index to add the new item.
Container.Indexed.addItemAt(int)
public void addListener(Container.PropertySetChangeListener listener)
addListener
in interface Container.PropertySetChangeNotifier
listener
- the new Listener to be registeredpublic void removeListener(Container.PropertySetChangeListener listener)
removeListener
in interface Container.PropertySetChangeNotifier
listener
- listener to be removedpublic void addListener(Container.ItemSetChangeListener listener)
addListener
in interface Container.ItemSetChangeNotifier
listener
- listener to be addedpublic void removeListener(Container.ItemSetChangeListener listener)
removeListener
in interface Container.ItemSetChangeNotifier
listener
- listener to be removedpublic void addListener(Property.ValueChangeListener listener)
addListener
in interface Property.ValueChangeNotifier
listener
- the new Listener to be registeredpublic void removeListener(Property.ValueChangeListener listener)
removeListener
in interface Property.ValueChangeNotifier
listener
- listener to be removed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |