de.cau.cs.kieler.core.properties
Class Property<T>

java.lang.Object
  extended by de.cau.cs.kieler.core.properties.Property<T>
Type Parameters:
T - type of the property
All Implemented Interfaces:
IProperty<T>, Comparable<IProperty<?>>

public class Property<T>
extends Object
implements IProperty<T>, Comparable<IProperty<?>>

A property that uses a string for identification.

Rating red

Constructor Summary
Property(IProperty<T> other, T thedefaultValue)
          Creates a property using another property as identifier, but changing the default value.
Property(String theid)
          Creates a property with given identifier and null as default value.
Property(String theid, T thedefaultValue)
          Creates a property with given identifier and default value.
 
Method Summary
 int compareTo(IProperty<?> other)
          
 boolean equals(Object obj)
          
 T getDefault()
          Returns the default value of this property.
 Object getIdentifier()
          Returns an object that can be used as identifier for this property.
 int hashCode()
          
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Property

public Property(String theid)
Creates a property with given identifier and null as default value.

Parameters:
theid - the identifier

Property

public Property(String theid,
                T thedefaultValue)
Creates a property with given identifier and default value.

Parameters:
theid - the identifier
thedefaultValue - the default value

Property

public Property(IProperty<T> other,
                T thedefaultValue)
Creates a property using another property as identifier, but changing the default value.

Parameters:
other - another property
thedefaultValue - the new default value
Method Detail

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

toString

public String toString()

Overrides:
toString in class Object

getDefault

public T getDefault()
Returns the default value of this property.

Specified by:
getDefault in interface IProperty<T>
Returns:
the default value

getIdentifier

public Object getIdentifier()
Returns an object that can be used as identifier for this property.

Specified by:
getIdentifier in interface IProperty<T>
Returns:
an identifier

compareTo

public int compareTo(IProperty<?> other)

Specified by:
compareTo in interface Comparable<IProperty<?>>