Open Business Objects for EDI
v3.6.0

com.americancoders.edi
Class BinaryTokenizer

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

public class BinaryTokenizer
extends java.lang.Object
implements IDataTokenizer


Field Summary
protected  java.util.Vector allTokens
          where all the substrings are stored
protected  int currentPos
          current position within tokenized string
protected  int stringLength
          length of field
protected  java.lang.String tokens
          what breaks up fields
protected  java.lang.String tokenString
          current tokenized string
 
Constructor Summary
BinaryTokenizer(java.lang.String inString, java.lang.String inTokens, com.americancoders.edi.ReaderTokenizer mainTokenizer)
          constructor for Binary Tokenizer (X12 BIN Segments)
first field contains length of data
second field contains binary data (including token seperators)
so if the incoming string is too short, we must go back to the main tokeninzer and ask for the rest of the string
 
Method Summary
 int countTokens()
          how many tokens in list
 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
 java.lang.String getTokenString()
           
 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
 
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


stringLength

protected int stringLength
length of field


tokenString

protected java.lang.String tokenString
current tokenized string


tokens

protected java.lang.String tokens
what breaks up fields


allTokens

protected java.util.Vector allTokens
where all the substrings are stored

Constructor Detail

BinaryTokenizer

public BinaryTokenizer(java.lang.String inString,
                       java.lang.String inTokens,
                       com.americancoders.edi.ReaderTokenizer mainTokenizer)
                throws OBOEException
constructor for Binary Tokenizer (X12 BIN Segments)
first field contains length of data
second field contains binary data (including token seperators)
so if the incoming string is too short, we must go back to the main tokeninzer and ask for the rest of the string

Parameters:
inString - incoming string to tokenize
inTokens - token seperators
mainTokenizer - tokenizer that does that bulk of the work
Throws:
OBOEException - - most likely length error
Method Detail

nextToken

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

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

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

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

getTokenString

public java.lang.String getTokenString()

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.