|
Jive Forums API (5.5.20.2-oracle) Developer Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jivesoftware.profiles.search.LexicographicalUtils
public class LexicographicalUtils
Provides support for converting longs to Strings, and back again. The strings are structured so that lexicographic sorting order is preserved.
That is, if l1 is less than l2 for any two longs l1 and l2, then LongField.longToString(l1) is lexicographically less than LongField.longToString(l2). (Similarly for "greater than" and "equals".) This class handles all long values.
Field Summary | |
---|---|
static int |
DECIMAL_PRECISION
the precision in which to convert decimal values |
static java.lang.String |
MAX_STRING_VALUE
Equivalent to longToString(Long.MAX_VALUE) |
static java.lang.String |
MIN_STRING_VALUE
Equivalent to longToString(Long.MIN_VALUE) |
static int |
STR_SIZE
the length of all strings returned by longToString |
Constructor Summary | |
---|---|
LexicographicalUtils()
|
Method Summary | |
---|---|
static java.lang.String |
doubleToString(double d)
|
static java.lang.String |
longToString(long l)
Converts a long to a String suitable for indexing. |
static double |
stringToDouble(java.lang.String str)
|
static long |
stringToLong(java.lang.String str)
Converts a String that was returned by [EMAIL PROTECTED] #longToString} back to a long. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String MIN_STRING_VALUE
public static final java.lang.String MAX_STRING_VALUE
public static final int STR_SIZE
public static final int DECIMAL_PRECISION
Constructor Detail |
---|
public LexicographicalUtils()
Method Detail |
---|
public static java.lang.String longToString(long l)
public static long stringToLong(java.lang.String str)
java.lang.IllegalArgumentException
- if the input is null
java.lang.NumberFormatException
- if the input does not parse (it was not a String
returned by longToString()).public static java.lang.String doubleToString(double d)
public static double stringToDouble(java.lang.String str)
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |