com.vaadin.data.util.
Class PropertysetItem
java.lang.Object
com.vaadin.data.util.PropertysetItem
All Implemented Interfaces:
Item, Item.PropertySetChangeNotifier, Serializable, Cloneable
Direct Known Subclasses:
- extends Object
- implements Item, Item.PropertySetChangeNotifier, Cloneable
public class PropertysetItem
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:
6.8.18
Author:
Vaadin Ltd.
See Also:
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.vaadin.data.Item |
---|
Item.Editor, Item.PropertySetChangeListener, Item.PropertySetChangeNotifier, Item.Viewer |
Constructor Summary | |
---|---|
PropertysetItem()
|
Method Summary | |
---|---|
boolean |
addItemProperty(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. |
Object |
clone()
Creates and returns a copy of this object. |
boolean |
equals(Object obj)
|
Property |
getItemProperty(Object id)
Gets the Property corresponding to the given Property ID stored in the Item. |
Collection<?> |
getItemPropertyIds()
Gets the collection of IDs of all Properties stored in the Item. |
Collection<?> |
getListeners(Class<?> eventType)
|
int |
hashCode()
|
boolean |
removeItemProperty(Object id)
Removes the Property identified by ID from the Item. |
void |
removeListener(Item.PropertySetChangeListener listener)
Removes a previously registered property set change listener. |
String |
toString()
Gets the String representation of the contents of the Item. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
PropertysetItem
public PropertysetItem()
Method Detail |
---|
getItemProperty
public Property getItemProperty(Object id)
- Specified by:
getItemProperty
in interfaceItem
- Parameters:
id
- the identifier of the Property to get.- Returns:
- the Property with the given ID or
null
Gets the Property corresponding to the given Property ID stored in the
Item. If the Item does not contain the Property, null
is
returned.
getItemPropertyIds
public Collection<?> getItemPropertyIds()
- Specified by:
getItemPropertyIds
in interfaceItem
- Returns:
- unmodifiable collection containing IDs of the Properties stored the Item
Gets the collection of IDs of all Properties stored in the Item.
removeItemProperty
public boolean removeItemProperty(Object id)
- Specified by:
removeItemProperty
in interfaceItem
- Parameters:
id
- the ID of the Property to be removed.- Returns:
true
if the operation succeededfalse
if not
Removes the Property identified by ID from the Item. This functionality
is optional. If the method is not implemented, the method always returns
false
.
addItemProperty
public boolean addItemProperty(Object id,
Property property)
- Specified by:
addItemProperty
in interfaceItem
- Parameters:
id
- the ID of the new Property.property
- the Property to be added and associated with the id.- Returns:
true
if the operation succeeded,false
if not
Tries to add a new Property into the Item.
toString
public String toString()
- Returns:
String
representation of the Item contents
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.
addListener
public void addListener(Item.PropertySetChangeListener listener)
- Specified by:
addListener
in interfaceItem.PropertySetChangeNotifier
- Parameters:
listener
- the new Listener to be registered.
Registers a new property set change listener for this Item.
removeListener
public void removeListener(Item.PropertySetChangeListener listener)
- Specified by:
removeListener
in interfaceItem.PropertySetChangeNotifier
- Parameters:
listener
- the Listener to be removed.
Removes a previously registered property set change listener.
getListeners
public Collection<?> getListeners(Class<?> eventType)
clone
public Object clone()
throws CloneNotSupportedException
- Throws:
CloneNotSupportedException
- if the object's class does not support the Cloneable interface.- See Also:
Object.clone()
Creates and returns a copy of this object.
The method clone
performs a shallow copy of the
PropertysetItem
.
Note : All arrays are considered to implement the interface Cloneable. Otherwise, this method creates a new instance of the class of this object and initializes all its fields with exactly the contents of the corresponding fields of this object, as if by assignment, the contents of the fields are not themselves cloned. Thus, this method performs a "shallow copy" of this object, not a "deep copy" operation.
equals
public boolean equals(Object obj)
hashCode
public int hashCode()