Open Business Objects for EDI
v3.6.0

com.americancoders.edi
Class ReaderTokenizer

java.lang.Object
  |
  +--com.americancoders.edi.ReaderTokenizer
All Implemented Interfaces:
IDataTokenizer

public class ReaderTokenizer
extends java.lang.Object
implements IDataTokenizer

Tokenizes from a Reader Object


Field Summary
protected  int currentPos
          current position within tokenized string
protected  java.lang.String escapeCharacters
          escape characters to allow tokens in the text
protected  java.io.PushbackReader tokenReader
          current tokenized string
protected  java.lang.String tokens
          what breaks up fields
 
Constructor Summary
ReaderTokenizer(java.io.Reader inReader, java.lang.String inTokens, java.lang.String inEscapeCharacters)
          constructor
 
Method Summary
 int countTokens()
          how many tokens in list
 byte[] getMoreData(int inLength)
          pulls more data out of reader stream for binarytokenizer
 int getPositionInStream()
          returns the byte offset position of the token in the overall input stream
 java.lang.String getTokenAt(int pos)
          gets the token in tokenized string at a specifiec position
 boolean hasMoreElements()
          indicates if there are more data elements to parse
 java.lang.String nextToken()
          to get next token
 void setPositionInStream(int positionInStream)
          sets the byte offset position of the token in the input stream
 void setSkipChar(char inChar)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentPos

protected int currentPos
current position within tokenized string


tokenReader

protected java.io.PushbackReader tokenReader
current tokenized string


tokens

protected java.lang.String tokens
what breaks up fields


escapeCharacters

protected java.lang.String escapeCharacters
escape characters to allow tokens in the text

Constructor Detail

ReaderTokenizer

public ReaderTokenizer(java.io.Reader inReader,
                       java.lang.String inTokens,
                       java.lang.String inEscapeCharacters)
constructor

Parameters:
inReader - - Reader object containing tokenized data
inTokens - - list of tokens
inEscapeCharacters - - list of characters to escape and allow tokens in the text pass an empty string or null if no escape characters used
Method Detail

nextToken

public java.lang.String nextToken()
to get next token

Specified by:
nextToken in interface IDataTokenizer
Returns:
String - the next token

getMoreData

public byte[] getMoreData(int inLength)
                   throws OBOEException
pulls more data out of reader stream for binarytokenizer

Parameters:
inLength - int length
Returns:
byte[]
Throws:
OBOEException - - not enough data read

getTokenAt

public java.lang.String getTokenAt(int pos)
gets the token in tokenized string at a specifiec position

Specified by:
getTokenAt in interface IDataTokenizer
Parameters:
pos - int position, if < 0 or > the total returns null
Returns:
String

setSkipChar

public void setSkipChar(char inChar)

hasMoreElements

public boolean hasMoreElements()
indicates if there are more data elements to parse

Specified by:
hasMoreElements in interface IDataTokenizer
Returns:
boolean more to parse?

countTokens

public int countTokens()
how many tokens in list

Specified by:
countTokens in interface IDataTokenizer
Returns:
int - a count

getPositionInStream

public int getPositionInStream()
Description copied from interface: IDataTokenizer
returns the byte offset position of the token in the overall input stream

Specified by:
getPositionInStream in interface IDataTokenizer
Returns:
int

setPositionInStream

public void setPositionInStream(int positionInStream)
Description copied from interface: IDataTokenizer
sets the byte offset position of the token in the input stream

Specified by:
setPositionInStream in interface IDataTokenizer

Open Business Objects for EDI
v3.6.0


OBOE is a trademark or registered trademark of American Coders, Ltd. in the US and other countries.
Copyright 1999-2004 American Coders, Ltd.
POB 97462
Raleigh NC 27624 USA
All Rights Reserved.