|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jstatcom.util.CIString
public final class CIString
A case insensitive nonempty string. It stores the original upper/lowercase representation of a string but uses only the uppercase representation for comparisons. This is useful to keep the original string representation for rendering, for example for portfolio names, but make only case insensitive lookups. Furthermore, all strings all trimmed.
This class is immutable.
Constructor Summary | |
---|---|
CIString(java.lang.String s)
Creates a portfolio string from a regular string. |
Method Summary | |
---|---|
int |
compareTo(CIString s)
|
boolean |
equals(java.lang.Object o)
Overwrite equals to compare only uppercase representation. |
int |
hashCode()
Overwritten because equals was overwritten. |
java.lang.String |
toString()
Gets the original string. |
java.lang.String |
toUpperCase()
Gets the uppercase string. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CIString(java.lang.String s)
s
- regular string
java.lang.IllegalArgumentException
- if null
argument or if s
is
empty after trimmingMethod Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toUpperCase()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
true
if o is PFString
with same
uppercase representation, false
otherwisepublic int hashCode()
equals
was overwritten.
hashCode
in class java.lang.Object
public int compareTo(CIString s)
compareTo
in interface java.lang.Comparable<CIString>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |