org.jdtaus.core.container
Class Properties

java.lang.Object
  extended by org.jdtaus.core.container.ModelObject
      extended by org.jdtaus.core.container.Properties
All Implemented Interfaces:
Serializable, Cloneable

public class Properties
extends ModelObject
implements Cloneable, Serializable

Collection of properties.

Version:
$Id: Properties.java 8044 2009-07-02 01:29:05Z schulte2005 $
Author:
Christian Schulte
See Also:
Serialized Form

Constructor Summary
Properties()
           
 
Method Summary
 Object clone()
          Creates and returns a deep copy of this object.
 boolean equals(Object o)
          Indicates whether some other object is equal to this one by comparing the values of all properties.
 Property[] getProperties()
          Gets the properties of the collection.
 Property getProperty(int index)
          Gets a property for an index.
 Property getProperty(String name)
          Gets a property for a name.
 int hashCode()
          Returns a hash code value for this object.
 void setProperties(Property[] value)
          Setter for property properties.
 Property setProperty(Property property)
          Setter for a named property from property properties.
 int size()
          Gets the number of properties held by the instance.
 String toString()
          Returns a string representation of the object.
 
Methods inherited from class org.jdtaus.core.container.ModelObject
getDocumentation, getModelVersion, setDocumentation, setModelVersion
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Properties

public Properties()
Method Detail

clone

public Object clone()
Creates and returns a deep copy of this object.

Overrides:
clone in class Object
Returns:
a clone of this instance.

equals

public boolean equals(Object o)
Indicates whether some other object is equal to this one by comparing the values of all properties.

Overrides:
equals in class Object
Parameters:
o - the reference object with which to compare.
Returns:
true if this object is the same as o; false otherwise.

getProperties

public Property[] getProperties()
Gets the properties of the collection.

Returns:
the properties of the collection.

getProperty

public final Property getProperty(int index)
Gets a property for an index.

Parameters:
index - the index of the property to return.
Returns:
a reference to the property at index.
Throws:
IndexOutOfBoundsException - if index is negativ, greater than or equal to size().

getProperty

public Property getProperty(String name)
Gets a property for a name.

Parameters:
name - the name of the property to return.
Returns:
a reference to the property named name.
Throws:
NullPointerException - if name is null.
MissingPropertyException - if no property matching name exists in the collection.

hashCode

public int hashCode()
Returns a hash code value for this object.

Overrides:
hashCode in class Object
Returns:
a hash code value for this object.

setProperties

public void setProperties(Property[] value)
Setter for property properties.

Parameters:
value - the new collection of properties.
Throws:
DuplicatePropertyException - if value contains duplicate properties.

setProperty

public Property setProperty(Property property)
Setter for a named property from property properties.

Parameters:
property - the property to update or to add to property properties.
Returns:
previous value of the property named property.getName() or null if no property with name property.getName() existed before.
Throws:
NullPointerException - if property is null.
IllegalArgumentException - if a property with the same name but different type exists.

size

public final int size()
Gets the number of properties held by the instance.

Returns:
the number of properties held by the instance.

toString

public String toString()
Returns a string representation of the object.

Overrides:
toString in class Object
Returns:
a string representation of the object.


Copyright © 2005-2009 jDTAUS. All Rights Reserved.