|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.claritysys.util.FixedWidthStringParser
public final class FixedWidthStringParser
A parser to break apart fixed-width records. Similar to the parse() methods of java.util.Format in that it maintains its position as you progress. Also similar to StringTokenizer, except fields are delimited by their size, not by tokens.
FixedWidthStringParser parser = new FixedWidthStringParser (myString); String field1 = parser.getField (12); String field2 = parser.getField (4); parser.reset (); ...
Constructor Summary | |
---|---|
FixedWidthStringParser(java.lang.String string)
Create a new FixedWidthStringParser to parse the given String. |
Method Summary | |
---|---|
java.lang.String |
getField(int size)
Get the next field. |
int |
getIntField(int size)
Get the next field as an int. |
java.lang.String |
getRemaining()
Get whatever remains. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FixedWidthStringParser(java.lang.String string)
string
- The String to parse.Method Detail |
---|
public java.lang.String getField(int size)
size
- The size of the field, in characters.
public int getIntField(int size)
size
- The size of the field, in characters.
public java.lang.String getRemaining()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |