dsto.dfc.collections
Interface PropertySet

All Known Implementing Classes:
BasicPropertySet, EmptyPropertySet, FixedPropertySet, UnmodifiablePropertySet

public interface PropertySet

A set of (name, value) pairs.

Version:
$Revision$

Field Summary
static PropertySet EMPTY_PROPERTY_SET
           
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener l)
           
 void addPropertyValue(String propertyName, Object value)
          Add a values to the end of the list of property values.
 void addPropertyValues(String propertyName, List values)
          Add a set of values to a property.
 Object clone()
           
 Set getPropertyNames()
          The names of defined properties.
 Object getPropertyValue(String propertyName)
          Get the value of a property.
 List getPropertyValues(String propertyName)
          The values of a property.
 boolean hasProperty(String propertyName)
          True if a property has any defined values.
 boolean isModifiable()
          True if property set may be changed.
 void removeAll()
          Undefine all properties in the set
 void removeProperty(String propertyName)
          Remove all values of a property (ie undefine it).
 void removePropertyChangeListener(PropertyChangeListener l)
           
 boolean removePropertyValue(String propertyName, Object value)
          Remove the first occurrence of a value from a list of property values.
 void setPropertyValue(String propertyName, Object value)
           
 void setPropertyValues(String propertyName, List values)
          Set the values of a property.
 

Field Detail

EMPTY_PROPERTY_SET

static final PropertySet EMPTY_PROPERTY_SET
Method Detail

getPropertyNames

Set getPropertyNames()
The names of defined properties.

Returns:
An immutable set of strings.

getPropertyValues

List getPropertyValues(String propertyName)
The values of a property.

Parameters:
propertyName - The name of the property.
Returns:
The values for propertyName, or null if no values are defined.

getPropertyValue

Object getPropertyValue(String propertyName)
Get the value of a property. If more than one value exists, the last added value is returned.


setPropertyValues

void setPropertyValues(String propertyName,
                       List values)
                       throws UnsupportedOperationException
Set the values of a property.

Throws:
UnsupportedOperationException - if property values cannot be changed.

setPropertyValue

void setPropertyValue(String propertyName,
                      Object value)
                      throws UnsupportedOperationException
Throws:
UnsupportedOperationException

removeProperty

void removeProperty(String propertyName)
                    throws UnsupportedOperationException
Remove all values of a property (ie undefine it).

Throws:
UnsupportedOperationException - if property values cannot be changed.

removePropertyValue

boolean removePropertyValue(String propertyName,
                            Object value)
                            throws UnsupportedOperationException
Remove the first occurrence of a value from a list of property values.

Returns:
True if the property set was changed (ie a value was removed).
Throws:
UnsupportedOperationException - if property values cannot be changed.

hasProperty

boolean hasProperty(String propertyName)
True if a property has any defined values.


removeAll

void removeAll()
               throws UnsupportedOperationException
Undefine all properties in the set

Throws:
UnsupportedOperationException - if property values cannot be changed.

addPropertyValue

void addPropertyValue(String propertyName,
                      Object value)
                      throws UnsupportedOperationException
Add a values to the end of the list of property values.

Throws:
UnsupportedOperationException - if property values cannot be changed.

isModifiable

boolean isModifiable()
True if property set may be changed.


addPropertyValues

void addPropertyValues(String propertyName,
                       List values)
                       throws UnsupportedOperationException
Add a set of values to a property.

Throws:
UnsupportedOperationException - if property values cannot be changed.

clone

Object clone()
             throws CloneNotSupportedException
Throws:
CloneNotSupportedException

addPropertyChangeListener

void addPropertyChangeListener(PropertyChangeListener l)

removePropertyChangeListener

void removePropertyChangeListener(PropertyChangeListener l)


Copyright © 2008 Commonwealth of Australia