|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectHTTPClient.CIString
This class' raison d'etre is that I want to use a Hashtable using Strings as keys and I want the lookup be case insensitive, but I also want to be able retrieve the keys with original case (otherwise I could just use toLowerCase() in the get() and put()). Since the class String is final we create a new class that holds the string and overrides the methods hashCode() and equals().
| Constructor Summary | |
CIString(String string)
the constructor |
|
| Method Summary | |
boolean |
equals(Object obj)
Uses the case insensitive comparison. |
String |
getString()
return the original string |
int |
hashCode()
the hash code was precomputed |
String |
toString()
Just return the internal string. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public CIString(String string)
| Method Detail |
public final String getString()
public int hashCode()
public boolean equals(Object obj)
public String toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||