|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.conradroche.matra.data.Data
Utility class to parse a String.
Field Summary | |
static int |
CHAR_NOT_FOUND
Denotes that the char searched was not found. |
static char |
END_OF_DATA_CHAR
Denotes end of data stream. |
static int |
FOUND_CHAR
Denotes that the char searched was found. |
Constructor Summary | |
Data()
Data constructor. |
|
Data(Data newData)
Data copy constructor. |
|
Data(java.lang.String strData)
Data Constructor. |
Method Summary | |
int |
checkNextChar(char lookupChar)
Checks if the next char is the one specified. |
boolean |
endOfData()
Check if the end of the data stream is reached. |
int |
getColumn()
Returns the current column being read. |
CursorLocation |
getCurrentLocation()
Returns the current location in terms of rows and columns. |
int |
getCurrentPosition()
Get the current reading position in the Data stream - as measured in the number of chars from the beginning of the data. |
char |
getNextChar()
Read the next char from the data stream. |
char |
getPrevChar()
Get the previous char read from the data stream. |
java.lang.String |
getRemaining()
Get the unread part of the data stream. |
int |
getRow()
Returns the current row being read. |
int |
length()
Get the total length of the data stream. |
char |
lookNextChar()
Peek at the next char to be read. |
char |
peekAhead(int numChars)
Peek ahead n number of chars from the data. |
void |
reset()
Reset the data for use. |
void |
rewind()
Move the current read position back to the beginning of the data stream. |
java.lang.String |
toString()
Return the String representation of the data stream. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final char END_OF_DATA_CHAR
public static final int FOUND_CHAR
public static final int CHAR_NOT_FOUND
Constructor Detail |
public Data()
public Data(Data newData)
public Data(java.lang.String strData)
StrData
- The data to be parsed.Method Detail |
public boolean endOfData()
true
of end of data is reached; false
if end of data is not reached.public CursorLocation getCurrentLocation()
public int getRow()
public int getColumn()
public int getCurrentPosition()
public char getNextChar()
public int checkNextChar(char lookupChar)
FOUND_CHAR
if the next
char is the one specified, returns
CHAR_NOT_FOUND
if not.public char getPrevChar()
public java.lang.String getRemaining()
public int length()
public char lookNextChar()
public char peekAhead(int numChars)
numChars
- Number of characters to peek ahead.
0
will return current char,
1
will return next charpublic void reset()
public void rewind()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |