|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectDataParser
public class DataParser
Parses data from a string or text file. The input data format is not documented here yet. Sorry!
Constructor Summary | |
---|---|
DataParser()
Constructs a data parser with default state. |
Method Summary | |
---|---|
java.lang.StringBuilder |
createStringFromFile(java.lang.String filename)
Creates a single character string from a file. |
javax.vecmath.Color3f |
getColor3f()
Gets a color and advances the token stream. |
double |
getDouble()
Gets a double and advances the token stream. |
float |
getFloat()
Gets a float and advances the token stream. |
int |
getInteger()
Gets an integer and advances the token stream. |
javax.vecmath.Point3d |
getPoint3d()
Gets a point and advances the token stream. |
java.lang.String |
getString()
Gets a string and advances the token stream. |
javax.vecmath.Vector3d |
getVector3d()
Gets a vector and advances the token stream. |
boolean |
parse(java.lang.CharSequence input,
java.lang.String regularExpression)
Parses the input sequence using the specified regular expression, and sets the data parser to the first token. |
boolean |
parseFile(java.lang.String filename,
java.lang.String regularExpression)
Parses data from a file. |
boolean |
parseString(java.lang.String dataString,
java.lang.String regularExpression)
Parses data from a string. |
boolean |
tokensRemaining()
Checks whether there are any tokens remaining. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DataParser()
Method Detail |
---|
public boolean parse(java.lang.CharSequence input, java.lang.String regularExpression)
input
- The character data to parse.regularExpression
- The regular expression used to parse the character data.
public boolean parseString(java.lang.String dataString, java.lang.String regularExpression)
dataString
- The character data to parse.regularExpression
- The regular expression to parse the character data with.
public boolean parseFile(java.lang.String filename, java.lang.String regularExpression) throws java.io.FileNotFoundException, java.io.IOException
filename
- The name of the file with character data to parse.regularExpression
- The regular expression to parse the file with.
java.io.FileNotFoundException
java.io.IOException
public java.lang.StringBuilder createStringFromFile(java.lang.String filename) throws java.io.FileNotFoundException, java.io.IOException
filename
- The name of the file to create a string out of.
java.io.FileNotFoundException
java.io.IOException
public boolean tokensRemaining()
public int getInteger()
public double getDouble()
public float getFloat()
public java.lang.String getString()
public javax.vecmath.Vector3d getVector3d()
public javax.vecmath.Point3d getPoint3d()
public javax.vecmath.Color3f getColor3f()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |