|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--heasarc.util.NumberParser
This class provides routines for efficient parsing of character arrays.
Constructor Summary | |
NumberParser(char[] input)
Construct a parser. |
Method Summary | |
int |
getNumberLength()
Get the number of characters used to parse the previous number |
int |
getOffset()
Get the current offset |
static void |
main(java.lang.String[] args)
Test routine |
boolean |
readBoolean(int length)
Get a boolean value. |
double |
readDouble(int length)
Convert a segment to a double. |
float |
readFloat(int length)
Convert a segment to a float Leading spaces are ignored. |
int |
readInt(int length)
Convert a segment to an int Leading spaces are ignored. |
long |
readLong(int length)
Convert a segment to a long Leading spaces are ignored. |
java.lang.String |
readString(int length)
Get a string (trimmed on the right) |
void |
setOffset(int offset)
Set the offset into the array. |
int |
skipWhite(int length)
Skip white space. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public NumberParser(char[] input)
input
- The character array to be parsed.Method Detail |
public static void main(java.lang.String[] args)
public void setOffset(int offset)
offset
- The desired offset from the beginning
of the array.public int getOffset()
public int getNumberLength()
public double readDouble(int length)
length
- The maximum number of characters
used to parse this numberpublic float readFloat(int length)
length
- The maximum number of characters
used to parse this numberpublic int readInt(int length)
length
- The maximum number of characters
used to parse this numberpublic long readLong(int length)
length
- The maximum number of characters
used to parse this numberpublic java.lang.String readString(int length)
length
- The maximum length of the string.public boolean readBoolean(int length)
length
- The segment search length.public int skipWhite(int length)
length
- The maximum number of characters to skip.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |