com.sun.faban.harness.logging
Class FlexBuffer.Tokenizer

java.lang.Object
  extended by com.sun.faban.harness.logging.FlexBuffer.Tokenizer
Enclosing class:
FlexBuffer

public class FlexBuffer.Tokenizer
extends Object

A tokenizer for the FlexBuffer.


Constructor Summary
FlexBuffer.Tokenizer()
           
 
Method Summary
 boolean endOfData()
          Returns position of end of data.
 void flip()
          Copies the data from the current position to the beginning of the buffer.
 byte[] getLine()
          Gets the next line from the buffer.
 String getLineAsString()
          Gets the next line from the buffer, returning a string.
 String getTrimmedRemainder()
          Gets the rest of the line from the buffer, trims, and returns as a string.
 String nextToken(byte c)
          Returns next token.
 String nextToken(byte[] bytes)
          Returns next token.
 String nextToken(String s)
          Returns next token.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlexBuffer.Tokenizer

public FlexBuffer.Tokenizer()
Method Detail

getLine

public byte[] getLine()
Gets the next line from the buffer. The line may be terminated by a CR, LF, or CRLF. The EOL characters are not returned.

Returns:
A line from the buffer

getLineAsString

public String getLineAsString()
Gets the next line from the buffer, returning a string. The line may be terminated by CR, LF, or CRLF. The EOL character is also returned.

Returns:
A line from the buffer

getTrimmedRemainder

public String getTrimmedRemainder()
Gets the rest of the line from the buffer, trims, and returns as a string.

Returns:
The remainder of the line

nextToken

public String nextToken(byte[] bytes)
Returns next token.

Parameters:
bytes -
Returns:
String

nextToken

public String nextToken(byte c)
Returns next token.

Parameters:
c -
Returns:
String

nextToken

public String nextToken(String s)
Returns next token.

Parameters:
s -
Returns:
String

endOfData

public boolean endOfData()
Returns position of end of data.

Returns:
boolean

flip

public void flip()
Copies the data from the current position to the beginning of the buffer. Data before the current position is discarded.