org.jdtaus.core.container
Class Properties

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

public class Properties
extends Object
implements Cloneable, Serializable

Collection of properties.

Version:
$Id: Properties.java 2230 2007-03-26 01:37:48Z 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 .
 Property setProperty(Property property)
          Setter for a named property from property .
 int size()
          Gets the number of properties held by the instance.
 String toString()
          Returns a string representation of the object.
 
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.

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.

Parameters:
o - the reference object with which to compare.
Returns:
if this object is the same as ; 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 .
Throws:
IndexOutOfBoundsException - if is negativ, greater than or equal to .

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 .
Throws:
NullPointerException - if is .
MissingPropertyException - if no property matching exists in the collection.

hashCode

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

Returns:
a hash code value for this object.

setProperties

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

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

setProperty

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

Parameters:
property - the property to update or to add to property .
Returns:
previous value of the property named or if no property with name existed before.
Throws:
NullPointerException - if is .
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.

Returns:
a string representation of the object.


Copyright © 2005-2007 jDTAUS. All Rights Reserved.