javax.media.jai.util
Class CaselessStringKey

java.lang.Object
  |
  +--javax.media.jai.util.CaselessStringKey
All Implemented Interfaces:
Cloneable, Serializable

public final class CaselessStringKey
extends Object
implements Cloneable, Serializable

Class to use as the key in a java.util.Map. The case of the name is maintained but the equals() method performs case-insensitive comparison.

Since:
JAI 1.1
See Also:
PropertySourceImpl, Map, Serialized Form

Constructor Summary
CaselessStringKey(String name)
          Creates a CaselessStringKey for the given name.
 
Method Summary
 Object clone()
          Returns a clone of the CaselessStringKey as an Object.
 boolean equals(Object o)
          Whether another Object equals this one.
 String getName()
          Returns the internal name by reference.
 int hashCode()
          Returns a hash code value for the CaselessStringKey.
 void setName(String name)
          Stores the parameter by reference in the internal name.
 String toString()
          Returns the value returned by getName().
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CaselessStringKey

public CaselessStringKey(String name)
Creates a CaselessStringKey for the given name. The parameter name is stored by reference.
Throws:
IllegalArgumentException - if name is null.
Method Detail

hashCode

public int hashCode()
Returns a hash code value for the CaselessStringKey.
Overrides:
hashCode in class Object

getName

public String getName()
Returns the internal name by reference.

setName

public void setName(String name)
Stores the parameter by reference in the internal name.
Throws:
IllegalArgumentException - if name is null.

clone

public Object clone()
Returns a clone of the CaselessStringKey as an Object.
Overrides:
clone in class Object

equals

public boolean equals(Object o)
Whether another Object equals this one. This will obtain if and only if the parameter is non-null and is a CaselessStringKey whose lower case name equals the lower case name of this CaselessStringKey.
Overrides:
equals in class Object

toString

public String toString()
Returns the value returned by getName().
Overrides:
toString in class Object