sl
Class CaseInsensitiveString

java.lang.Object
  extended bysl.CaseInsensitiveString
All Implemented Interfaces:
java.io.Serializable

public class CaseInsensitiveString
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.

Version:
$Date: 2003/10/09 13:00:37 $ $Revision: 1.1.1.1 $
Author:
Giovanni Rimassa - Universita` di Parma
See Also:
Serialized Form

Field Summary
(package private)  java.lang.String s
           
 
Constructor Summary
CaseInsensitiveString(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
 

Field Detail

s

java.lang.String s
Constructor Detail

CaseInsensitiveString

public CaseInsensitiveString(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.

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.

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.


Copyright © 2000-2003 BT Exact Technologies. All Rights Reserved.