|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Container
A specialized set of identified Items. Basically the Container is a set of Items, but it imposes certain constraints on its contents. These constraints state the following:
Item.getItemPropertyIds()
).
The Container can be visualized as a representation of a relational database
table. Each Item in the Container represents a row in the table, and all
cells in a column (identified by a Property ID) have the same data type. Note
that as with the cells in a database table, no Property in a Container may be
empty, though they may contain null
values.
Note that though uniquely identified, the Items in a Container are not
neccessarily ordered
or indexed
.
The Container interface is split to several subinterfaces so that a class can implement only the ones it needs.
Nested Class Summary | |
---|---|
static interface |
Container.Editor
Interface implemented by the editor classes supporting editing the Container. |
static interface |
Container.Filterable
Interface is implemented by containers that allow reducing their visiblecontents with set of filters. |
static interface |
Container.Hierarchical
Interface for Container classes whose Items can be arranged
hierarchically. |
static interface |
Container.Indexed
Interface for Container classes whose Items can be indexed. |
static interface |
Container.ItemSetChangeEvent
An Event object specifying the Container whose Item set has
changed. |
static interface |
Container.ItemSetChangeListener
Container Item set change listener interface. |
static interface |
Container.ItemSetChangeNotifier
The interface for adding and removing ItemSetChangeEvent
listeners. |
static interface |
Container.Ordered
Interface for Container classes whose Items can be traversed in order. |
static interface |
Container.PropertySetChangeEvent
An Event object specifying the Container whose Property set
has changed. |
static interface |
Container.PropertySetChangeListener
The listener interface for receiving PropertySetChangeEvent
objects. |
static interface |
Container.PropertySetChangeNotifier
The interface for adding and removing PropertySetChangeEvent
listeners. |
static interface |
Container.Sortable
Interface for Container classes whose Items can be sorted. |
static interface |
Container.Viewer
Interface implemented by viewer classes capable of using a Container as a data source. |
Method Summary | |
---|---|
boolean |
addContainerProperty(Object propertyId,
Class type,
Object defaultValue)
Adds a new Property to all Items in the Container. |
Object |
addItem()
Creates a new Item into the Container, and assign it an automatic ID. |
Item |
addItem(Object itemId)
Creates a new Item with the given ID into the Container. |
boolean |
containsId(Object itemId)
Tests if the Container contains the specified Item |
Property |
getContainerProperty(Object itemId,
Object propertyId)
Gets the Property identified by the given itemId and propertyId from the Container. |
Collection |
getContainerPropertyIds()
Gets the ID's of all Properties stored in the Container. |
Item |
getItem(Object itemId)
Gets the Item with the given Item ID from the Container. |
Collection |
getItemIds()
Gets the ID's of all Items stored in the Container. |
Class |
getType(Object propertyId)
Gets the data type of all Properties identified by the given Property ID. |
boolean |
removeAllItems()
Removes all Items from the Container. |
boolean |
removeContainerProperty(Object propertyId)
Removes a Property specified by the given Property ID from the Container. |
boolean |
removeItem(Object itemId)
Removes the Item identified by ItemId from the Container. |
int |
size()
Gets the number of Items in the Container. |
Method Detail |
---|
Item getItem(Object itemId)
null
is returned.
itemId
- ID of the Item to retrieve
null
if the Item is
not found in the ContainerCollection getContainerPropertyIds()
Collection getItemIds()
Property getContainerProperty(Object itemId, Object propertyId)
null
is returned.
itemId
- ID of the Item which contains the PropertypropertyId
- ID of the Property to retrieve
null
Class getType(Object propertyId)
propertyId
- ID identifying the Properties
int size()
boolean containsId(Object itemId)
itemId
- ID the of Item to be tested
Item addItem(Object itemId) throws UnsupportedOperationException
Item is returned, and it is ready to have its Properties modified.
Returns null
if the operation fails or the Container already
contains a Item with the given ID.
This functionality is optional.
itemId
- ID of the Item to be created
null
in case of a failure
UnsupportedOperationException
Object addItem() throws UnsupportedOperationException
The new ID is returned, or null
if the operation fails.
After a successful call you can use the
method to fetch the Item.
getItem
This functionality is optional.
null
in case of a
failure
UnsupportedOperationException
boolean removeItem(Object itemId) throws UnsupportedOperationException
ItemId
from the Container.
This functionality is optional.
itemId
- ID of the Item to remove
true
if the operation succeeded, false
if not
UnsupportedOperationException
boolean addContainerProperty(Object propertyId, Class type, Object defaultValue) throws UnsupportedOperationException
propertyId
- ID of the Propertytype
- Data type of the new PropertydefaultValue
- The value all created Properties are initialized to
true
if the operation succeeded, false
if not
UnsupportedOperationException
boolean removeContainerProperty(Object propertyId) throws UnsupportedOperationException
propertyId
- ID of the Property to remove
true
if the operation succeeded, false
if not
UnsupportedOperationException
boolean removeAllItems() throws UnsupportedOperationException
Note that Property ID and type information is preserved. This functionality is optional.
true
if the operation succeeded, false
if not
UnsupportedOperationException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |