org.millstone.base.data.util
Class PropertysetItem

java.lang.Object
  |
  +--org.millstone.base.data.util.PropertysetItem
All Implemented Interfaces:
Item, Item.PropertySetChangeNotifier
Direct Known Subclasses:
BeanItem

public class PropertysetItem
extends java.lang.Object
implements Item, Item.PropertySetChangeNotifier

Class for handling a set of identified Properties. The elements contained in a MapItem can be referenced using locally unique identifiers. The class supports listeners who are interested in changes to the Property set managed by the class.

Since:
3.0
Version:
3.0.3
Author:
IT Mill Ltd.

Nested Class Summary
 
Nested classes inherited from class org.millstone.base.data.Item
Item.Editor, Item.PropertySetChangeEvent, Item.PropertySetChangeListener, Item.PropertySetChangeNotifier, Item.Viewer
 
Constructor Summary
PropertysetItem()
           
 
Method Summary
 boolean addItemProperty(java.lang.Object id, Property property)
          Tries to add a new Property into the Item.
 void addListener(Item.PropertySetChangeListener listener)
          Registers a new property set change listener for this Item.
 Property getItemProperty(java.lang.Object id)
          Gets the Property corresponding to the given Property ID stored in the Item.
 java.util.Collection getItemPropertyIds()
          Gets the collection of IDs of all Properties stored in the Item.
 boolean removeItemProperty(java.lang.Object id)
          Removes the Property identified by ID from the Item.
 void removeListener(Item.PropertySetChangeListener listener)
          Removes a previously registered property set change listener.
 java.lang.String toString()
          Gets the String representation of the contents of the Item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PropertysetItem

public PropertysetItem()
Method Detail

getItemProperty

public Property getItemProperty(java.lang.Object id)
Gets the Property corresponding to the given Property ID stored in the Item. If the Item does not contain the Property, null is returned.

Specified by:
getItemProperty in interface Item
Parameters:
id - identifier of the Property to get
Returns:
the Property with the given ID or null

getItemPropertyIds

public java.util.Collection getItemPropertyIds()
Gets the collection of IDs of all Properties stored in the Item.

Specified by:
getItemPropertyIds in interface Item
Returns:
unmodifiable collection containing IDs of the Properties stored the Item

removeItemProperty

public boolean removeItemProperty(java.lang.Object id)
Removes the Property identified by ID from the Item. This functionality is optional. If the method is not implemented, the method always returns false.

Specified by:
removeItemProperty in interface Item
Parameters:
id - ID of the Property to be removed
Returns:
true if the operation succeeded false if not

addItemProperty

public boolean addItemProperty(java.lang.Object id,
                               Property property)
Tries to add a new Property into the Item.

Specified by:
addItemProperty in interface Item
Parameters:
id - ID of the new Property
property - the Property to be added and associated with id
Returns:
true if the operation succeeded, false if not

toString

public java.lang.String toString()
Gets the String representation of the contents of the Item. The format of the string is a space separated catenation of the String representations of the Properties contained by the Item.

Overrides:
toString in class java.lang.Object
Returns:
String representation of the Item contents

addListener

public void addListener(Item.PropertySetChangeListener listener)
Registers a new property set change listener for this Item.

Specified by:
addListener in interface Item.PropertySetChangeNotifier
Parameters:
listener - The new Listener to be registered.

removeListener

public void removeListener(Item.PropertySetChangeListener listener)
Removes a previously registered property set change listener.

Specified by:
removeListener in interface Item.PropertySetChangeNotifier
Parameters:
listener - Listener to be removed.


Copyright © 2000,2001,2002 IT Mill Ltd. All Rights Reserved.