Class COM.ibm.jaws.motk.Tokenizer
All Packages Class Hierarchy This Package Previous Next Index
Class COM.ibm.jaws.motk.Tokenizer
java.lang.Object
|
+----COM.ibm.jaws.motk.Tokenizer
- public class Tokenizer
- extends Object
Parses a character stream into tokens based on a set of specified
delimiter characters. Delimiter characters proceeded by the specified
escape character will be used to end tokens.
-
d
-
-
Tokenizer(CharProducer, String, char)
- Creates a new Tokenizer.
-
read(StringBuffer, boolean)
- Appends characters from the input CharProducer to the indicated
StringBuffer until a delimiter character or EOF is encountered.
-
trim(StringBuffer, int, char)
- Strips leading and trailing white space from the indicated
StringBuffer starting with the indicated position.
d
public static Debug d
Tokenizer
public Tokenizer(CharProducer in,
String delimiters,
char escape)
- Creates a new Tokenizer.
- Parameters:
- in - the input character stream
- delimiters - the characters used to end tokens
- escape - the character used to escape delimiters
read
public int read(StringBuffer buf,
boolean trim) throws IOException
- Appends characters from the input CharProducer to the indicated
StringBuffer until a delimiter character or EOF is encountered. The
delimiter character or EOF will be returned. Delimiter characters
proceeded may be escaped. The escape sequences are not removed.
- Parameters:
- buf - a StringBuffer that recieves the token.
appended to it.
- trim - if true the leading and trailing whitespace will be
removed.
- Returns:
- the delimiter character or EOF (-1)
trim
public static void trim(StringBuffer buf,
int startPos,
char escape)
- Strips leading and trailing white space from the indicated
StringBuffer starting with the indicated position.
- Parameters:
- buf - the StringBuffer to be trimed, it will be modified.
- startPos - the position to start triming at. No data prior
to startPos will be modified.
All Packages Class Hierarchy This Package Previous Next Index