|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectkiwi.util.StringComparator
A string comparator. This class compares the string representations of two objects.
Field Summary | |
private boolean |
caseSensitive
|
Constructor Summary | |
StringComparator()
Construct a new case-sensitive StringComparator . |
|
StringComparator(boolean caseSensitive)
Construct a new StringComparator . |
Method Summary | |
int |
compare(java.lang.Object a,
java.lang.Object b)
Compare the string representations of two objects. |
boolean |
isCaseSensitive()
Determine if this comparator is case-sensitive. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private boolean caseSensitive
Constructor Detail |
public StringComparator()
StringComparator
.
public StringComparator(boolean caseSensitive)
StringComparator
.
caseSensitive
- A flag specifying whether comparisons will be
case-sensitive.Method Detail |
public boolean isCaseSensitive()
true
if the comparator is case-sensitive, and
false
otherwise.public int compare(java.lang.Object a, java.lang.Object b)
toString()
is performed on both objects, and then the
resulting strings are compared using the compareTo()
method
of the String
class.
compare
in interface Comparator
a
- The first object.b
- The second object.
0
if the objects are equal, -1
if
a
is less than b
, and 1
if
a
is greater than b
.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |