|
TopoWeb Commons API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--org.topoweb.util.Range
|
+--org.topoweb.util.StringRange
A Range based on the lexicographical order of the string
representation of Objects. This class just encapsulates
a StringComparator instance as the
Comparator used by its superclass.
Note: the ordering of the range is generally not consistent with
equals. If, however, the user can guarantee that for any two objects
a and b the expression a.equals(b) implies
a.toString().compareTo( b.toString() ), then the ordering
is consistent with equals.
| Field Summary | |
static StringRange |
ALL
The lexical range containing all strings. |
static StringRange |
Z
The lexical range containing only the empty string. |
| Constructor Summary | |
StringRange(java.lang.Object lo,
java.lang.Object hi)
Creates a new instance with the specified bounds. |
|
| Method Summary | |
boolean |
equals(java.lang.Object other)
Tests this instance for equality against the other
object. |
boolean |
equals(StringRange other)
Tests this instance for equality against the other
instance. |
java.lang.String |
getHiString()
Returns the upper bound as a string. |
java.lang.String |
getLoString()
Returns the lower bound as a string. |
int |
hashCode()
Returns the hash code. |
| Methods inherited from class org.topoweb.util.Range |
contains, getComparator, getHi, getLo, outcode |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final StringRange Z
public static final StringRange ALL
| Constructor Detail |
public StringRange(java.lang.Object lo,
java.lang.Object hi)
throws java.lang.IllegalArgumentException
lo - the inclusive lower bound for this rangehi - the exclusive upper bound for this range, or
null to indicate the highest
possible upper boundRange.Range(Object,Object,Comparator)| Method Detail |
public final java.lang.String getLoString()
public final java.lang.String getHiString()
null
represents the largest string.
public final int hashCode()
equals as per the contract in
java.lang.Object.
hashCode in class java.lang.Objectpublic final boolean equals(java.lang.Object other)
other
object.
equals in class java.lang.Objectother - the other object
true, iff other is
an instance of this class and
equals(StringRange)
returns trueequals(StringRange)public final boolean equals(StringRange other)
other
instance.
other - the other instance
true, iff the string representation
of the hi and lo of this range and other
are the same
|
TopoWeb Commons API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||