| org.millstone.base.data.Container
All known Subclasses: org.millstone.base.data.util.IndexedContainer, org.millstone.base.ui.Tree, org.millstone.base.ui.Select, org.millstone.base.ui.Table, org.millstone.base.data.util.ContainerOrderedWrapper, org.millstone.base.data.util.ContainerHierarchicalWrapper, org.millstone.base.data.util.HierarchicalContainer, org.millstone.base.data.util.FilesystemContainer,
Container | public interface Container (Code) | |
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:
- All Items in the Container must include the same number of Properties
- All Items in the Container must include the same Property ID sets (see
Item.getItemPropertyIds ).
- all Properties in the Items corresponding to the same Property ID must
have the same data type.
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
Container.Ordered ordered or
Container.Indexed indexed .
The Container interface is split to several subinterfaces so that a class can
implement only the ones it needs.
author: IT Mill Ltd version: 3.1.1 @since 3.0 |
Inner Class :public interface Ordered extends Container | |
Inner Class :public interface Sortable extends Ordered | |
Inner Class :public interface Indexed extends Ordered | |
Inner Class :public interface Hierarchical extends Container | |
Inner Class :public interface Viewer | |
Inner Class :public interface ItemSetChangeEvent | |
Inner Class :public interface ItemSetChangeListener | |
Inner Class :public interface ItemSetChangeNotifier | |
Inner Class :public interface PropertySetChangeEvent | |
Inner Class :public interface PropertySetChangeListener | |
Inner Class :public interface PropertySetChangeNotifier | |
addContainerProperty | public boolean addContainerProperty(Object propertyId, Class type, Object defaultValue) throws UnsupportedOperationException(Code) | | Adds a new Property to all Items in the Container. The Property ID, data
type and default value of the new Property are given as parameters.
This functionality is optional.
Parameters: propertyId - ID of the Property Parameters: type - Data type of the new Property Parameters: defaultValue - The value all created Properties are initialized to true if the operation succeeded,false if not |
addItem | public Item addItem(Object itemId) throws UnsupportedOperationException(Code) | | Creates a new Item with the given ID into the Container. The new
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.
Parameters: itemId - ID of the Item to be created Created new Item, or null in case of a failure |
addItem | public Object addItem() throws UnsupportedOperationException(Code) | | Creates a new Item into the Container, and assign it an automatic ID.
The new ID is returned, or null if the operation fails.
After a successful call you can use the
Container.getItem(Object ItemId) getItem method to fetch the
Item.
This functionality is optional.
ID of the newly created Item, or null in case of afailure |
containsId | public boolean containsId(Object itemId)(Code) | | Tests if the Container contains the specified Item
Parameters: itemId - ID the of Item to be tested boolean indicating if the Container holds the specified Item |
getContainerProperty | public Property getContainerProperty(Object itemId, Object propertyId)(Code) | | Gets the Property identified by the given itemId and propertyId from the
Container. If the Container does not contain the Property,
null is returned.
Parameters: itemId - ID of the Item which contains the Property Parameters: propertyId - ID of the Property to retrieve Property with the given ID or null |
getContainerPropertyIds | public Collection getContainerPropertyIds()(Code) | | Gets the ID's of all Properties stored in the Container. The ID's are
returned as a unmodifiable collection.
unmodifiable collection of Property IDs |
getItem | public Item getItem(Object itemId)(Code) | | Gets the Item with the given Item ID from the Container. If the Container
does not contain the requested Item, null is returned.
Parameters: itemId - ID of the Item to retrieve the Item with the given ID or null if the Item isnot found in the Container |
getItemIds | public Collection getItemIds()(Code) | | Gets the ID's of all Items stored in the Container. The ID's are returned
as a unmodifiable collection.
unmodifiable collection of Item IDs |
getType | public Class getType(Object propertyId)(Code) | | Gets the data type of all Properties identified by the given Property ID.
Parameters: propertyId - ID identifying the Properties data type of the Properties |
removeAllItems | public boolean removeAllItems() throws UnsupportedOperationException(Code) | | Removes all Items from the Container.
Note that Property ID and type information is preserved. This
functionality is optional.
true if the operation succeeded,false if not |
removeContainerProperty | public boolean removeContainerProperty(Object propertyId) throws UnsupportedOperationException(Code) | | Removes a Property specified by the given Property ID from the Container.
Note that the Property will be removed from all Items in the Container.
This functionality is optional.
Parameters: propertyId - ID of the Property to remove true if the operation succeeded,false if not |
removeItem | public boolean removeItem(Object itemId) throws UnsupportedOperationException(Code) | | Removes the Item identified by ItemId from the Container.
This functionality is optional.
Parameters: itemId - ID of the Item to remove true if the operation succeeded,false if not |
size | public int size()(Code) | | Gets the number of Items in the Container.
number of Items in the Container |
|
|