|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.vfny.geoserver.zserver.NumericField
Implements a way to turn numbers into comparable strings and vice versa, so that they can be indexed and compared by lucene.
| Field Summary | |
protected static int |
defaultLeft
The number of significant digits to the left of the decimal. |
protected static int |
defaultRight
The number of digits to the right of the decimal. |
protected static char |
NORM
The char to normalize against. |
| Constructor Summary | |
NumericField()
|
|
| Method Summary | |
protected static char |
fixupChar(char digit,
int signMultiplier)
Normalizes the digit into a character. |
static java.lang.String |
numberToString(java.lang.Double num)
Calls numberToString with default values for the left and right significant digits. |
static java.lang.String |
numberToString(java.lang.String numString)
Convenience method for the numberToString that takes a double. |
static java.lang.Double |
stringToNumber(java.lang.String s)
Calls stringToNumber with default values for the left and right significant digits. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static final char NORM
protected static final int defaultLeft
protected static final int defaultRight
| Constructor Detail |
public NumericField()
| Method Detail |
protected static char fixupChar(char digit,
int signMultiplier)
digit - The character of the digit to be fixed up.signMultiplier - should be 1 for positives, -1 for negatives.
public static java.lang.String numberToString(java.lang.String numString)
throws java.lang.NumberFormatException
numString - the string representation of a number.
java.lang.NumberFormatException - if the passed in string can't be parsed.public static java.lang.String numberToString(java.lang.Double num)
num - the number to convert.
public static java.lang.Double stringToNumber(java.lang.String s)
s - the lucene searchable string to be converted to a double.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||