jade.onto
Class Name

java.lang.Object
  |
  +--jade.onto.Name

public class Name
extends java.lang.Object
implements java.io.Serializable

A name string, with case insensitive comparison and equality operations. This class holds a String inside, preserving the case; however, all the equality and comparision operations are performed in a case insensitive fashion.

Author:
Giovanni Rimassa - Universita` di Parma
See Also:
Serialized Form

Constructor Summary
Name(java.lang.String name)
          Create a new Name object.
 
Method Summary
 boolean equals(java.lang.Object o)
          Equality operation.
 int hashCode()
          Hash code.
 java.lang.String toString()
          Converts the Name object into a string.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Name

public Name(java.lang.String name)
Create a new Name object.
Parameters:
name - The string that will be kept inside this object.
Method Detail

toString

public java.lang.String toString()
Converts the Name object into a string.
Returns:
The string stored inside by the constructor.
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Equality operation. This method compares a Name object with another or with a Java String. The comparison is case insensitive.
Parameters:
o - The Java object to compare this Name to.
Returns:
true if the strings contained within the two objects are equal, apart from case.
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Hash code. This method returns an hash code in such a way that two Name objects differing only in case have the same hash code.
Returns:
The hash code for this Name object.
Overrides:
hashCode in class java.lang.Object