org.treebind
Class DefaultPropertyImplementation

java.lang.Object
  extended byorg.treebind.DefaultPropertyImplementation
All Implemented Interfaces:
Property
Direct Known Subclasses:
ComplexProperty, LeafProperty

public abstract class DefaultPropertyImplementation
extends java.lang.Object
implements Property

Default implementation of a TreeBind property. This abstract class contains the implementation of methods that are common to the two different types of TreeBind properties (ie complex and leaf properties).

Author:
vdv
See Also:
Property, LeafProperty, ComplexProperty

Constructor Summary
DefaultPropertyImplementation()
           
 
Method Summary
 void addProperty(int position, Property property)
          Add a sub property at a specific position (for ComplexProperty only.
 void addProperty(Property property)
          Add a sub property (for ComplexProperty only.
 Name getNature()
          Get the nature of the property.
 java.util.Iterator getProperties()
          Get the subproperties of a property (for ComplexProperty only.
 java.util.Iterator getPropertiesWithNature(Name nature)
          Get the subproperties of a property with a specific nature (for ComplexProperty only.
 java.util.Iterator getPropertiesWithRole(Name role)
          Get the subproperties of a property with a specific role (for ComplexProperty only.
 java.util.Iterator getPropertiesWithRoleAndNature(Name role, Name nature)
          Get the subproperties of a property with a specific nature and a specific role (for ComplexProperty only.
 Name getRole()
          Get the role of a property.
 java.lang.Object getValue()
          Get the value of the property (for LeafProperty only).
 int nbProperties()
          Get the number of sub properties (for ComplexProperty only.
 void setNature(Name nature)
          Sets the nature of the property.
 void setRole(Name role)
          Sets the role of a property.
 void setValue(java.lang.Object value)
          Sets the value of a propety (for LeafProperty only).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultPropertyImplementation

public DefaultPropertyImplementation()
Method Detail

addProperty

public void addProperty(int position,
                        Property property)
                 throws NotImplementedException
Description copied from interface: Property
Add a sub property at a specific position (for ComplexProperty only.

Specified by:
addProperty in interface Property
Parameters:
property - the sub property
Throws:
NotImplementedException - when a property is added to a LeafProperty

addProperty

public void addProperty(Property property)
                 throws NotImplementedException
Description copied from interface: Property
Add a sub property (for ComplexProperty only.

Specified by:
addProperty in interface Property
Parameters:
property - the sub property
Throws:
NotImplementedException - when a property is added to a LeafProperty

getNature

public Name getNature()
Description copied from interface: Property
Get the nature of the property.

Specified by:
getNature in interface Property
Returns:
the natuure

getProperties

public java.util.Iterator getProperties()
Description copied from interface: Property
Get the subproperties of a property (for ComplexProperty only.

Specified by:
getProperties in interface Property
Returns:
an iterator over the sub properties.

getPropertiesWithNature

public java.util.Iterator getPropertiesWithNature(Name nature)
Description copied from interface: Property
Get the subproperties of a property with a specific nature (for ComplexProperty only.

Specified by:
getPropertiesWithNature in interface Property
Returns:
an iterator over the sub properties.

getPropertiesWithRole

public java.util.Iterator getPropertiesWithRole(Name role)
Description copied from interface: Property
Get the subproperties of a property with a specific role (for ComplexProperty only.

Specified by:
getPropertiesWithRole in interface Property
Returns:
an iterator over the sub properties.

getPropertiesWithRoleAndNature

public java.util.Iterator getPropertiesWithRoleAndNature(Name role,
                                                         Name nature)
Description copied from interface: Property
Get the subproperties of a property with a specific nature and a specific role (for ComplexProperty only.

Specified by:
getPropertiesWithRoleAndNature in interface Property
Returns:
an iterator over the sub properties.

getRole

public Name getRole()
Description copied from interface: Property
Get the role of a property.

Specified by:
getRole in interface Property
Returns:
the role

getValue

public java.lang.Object getValue()
Description copied from interface: Property
Get the value of the property (for LeafProperty only).

Specified by:
getValue in interface Property
Returns:
the value

nbProperties

public int nbProperties()
Description copied from interface: Property
Get the number of sub properties (for ComplexProperty only.

Specified by:
nbProperties in interface Property
Returns:
the number of sub properties

setNature

public void setNature(Name nature)
Description copied from interface: Property
Sets the nature of the property.

Specified by:
setNature in interface Property
Parameters:
nature - the nature

setRole

public void setRole(Name role)
Description copied from interface: Property
Sets the role of a property.

Specified by:
setRole in interface Property
Parameters:
role - the role

setValue

public void setValue(java.lang.Object value)
              throws NotImplementedException
Description copied from interface: Property
Sets the value of a propety (for LeafProperty only).

Specified by:
setValue in interface Property
Parameters:
value - the value
Throws:
NotImplementedException - when a value is set on a ComplexProperty