|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.lucene.document.NumberTools
NumericUtils
instead, which
provides a sortable binary representation (prefix encoded) of numeric
values.
To index and efficiently query numeric values use NumericField
and NumericRangeQuery
.
This class is included for use with existing
indices and will be removed in a future release.
public class NumberTools
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 NumberTools.longToString(l1) is lexicographically less than NumberTools.longToString(l2). (Similarly for "greater than" and "equals".)
This class handles all long values (unlike
DateField
).
Field Summary | |
---|---|
static java.lang.String |
MAX_STRING_VALUE
Deprecated. Equivalent to longToString(Long.MAX_VALUE) |
static java.lang.String |
MIN_STRING_VALUE
Deprecated. Equivalent to longToString(Long.MIN_VALUE) |
static int |
STR_SIZE
Deprecated. The length of (all) strings returned by longToString(long) |
Constructor Summary | |
---|---|
NumberTools()
Deprecated. |
Method Summary | |
---|---|
static java.lang.String |
longToString(long l)
Deprecated. Converts a long to a String suitable for indexing. |
static long |
stringToLong(java.lang.String str)
Deprecated. Converts a String that was returned by longToString(long) 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
longToString(long)
Constructor Detail |
---|
public NumberTools()
Method Detail |
---|
public static java.lang.String longToString(long l)
public static long stringToLong(java.lang.String str)
longToString(long)
back to a
long.
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()).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |