de.cau.cs.kieler.sim.kiem.config.data
Class AbstractStringWrapper

java.lang.Object
  extended by de.cau.cs.kieler.sim.kiem.config.data.AbstractStringWrapper
All Implemented Interfaces:
Serializable, Comparable<Object>
Direct Known Subclasses:
KiemPropertyKeyWrapper

public abstract class AbstractStringWrapper
extends Object
implements Comparable<Object>, Serializable

A wrapper for a string.

Can be used to ensure type safety of operations that would normally get a String as parameter and that String really encodes an identifier.

See Also:
Serialized Form
Rating proposed yellow
(2010-01-27)

Constructor Summary
AbstractStringWrapper(String string)
          Creates a new AbstractStringWrapper.
 
Method Summary
 int compareTo(Object another)
          Compares this with another Object.
 boolean equals(Object another)
          
 String getString()
          Getter for the contained string.
 int hashCode()
          
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractStringWrapper

public AbstractStringWrapper(String string)
Creates a new AbstractStringWrapper.

Parameters:
string - the string that should be wrapped.
Method Detail

getString

public String getString()
Getter for the contained string.

Returns:
the contained string.

compareTo

public int compareTo(Object another)
Compares this with another Object. Returns -1 if this object is smaller, 0 if both objects are equal and 1 if this object is bigger.

Specified by:
compareTo in interface Comparable<Object>
Parameters:
another - the object to compare with
Returns:
one of the values -1, 0, 1

equals

public boolean equals(Object another)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

toString

public String toString()

Overrides:
toString in class Object