org.cdlib.xtf.util
Class FastTokenizer.DribbleReader

Object
  extended by Reader
      extended by FastTokenizer.DribbleReader
All Implemented Interfaces:
Closeable, Readable
Enclosing class:
FastTokenizer

private class FastTokenizer.DribbleReader
extends Reader

This class is used, when the fast tokenizer encounters a questionable situation, to dribble out characters to a standard tokenizer that can do a more complete job.

Author:
Martin Haye

Field Summary
private  char[] buf
          Buffer of characters currently being dribbled
private  char[] fakeChars
          Character array version of fakeStr
(package private) static String fakeStr
          String used to mark the end of the dribbled text
private  int max
          Max # of chars to dribble from buf
private  int pos
          Current position within buf
 
Fields inherited from class Reader
lock
 
Constructor Summary
private FastTokenizer.DribbleReader()
           
 
Method Summary
 void close()
          Does nothing... required by interface
 int read(char[] cbuf, int off, int len)
          Dribble some characters.
 void setChars(char[] buf, int pos, int max)
          Establish a set of characters to dribble out
 
Methods inherited from class Reader
mark, markSupported, read, read, read, ready, reset, skip
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fakeStr

static final String fakeStr
String used to mark the end of the dribbled text

See Also:
Constant Field Values

fakeChars

private final char[] fakeChars
Character array version of fakeStr


buf

private char[] buf
Buffer of characters currently being dribbled


pos

private int pos
Current position within buf


max

private int max
Max # of chars to dribble from buf

Constructor Detail

FastTokenizer.DribbleReader

private FastTokenizer.DribbleReader()
Method Detail

close

public void close()
           throws IOException
Does nothing... required by interface

Specified by:
close in interface Closeable
Specified by:
close in class Reader
Throws:
IOException

setChars

public void setChars(char[] buf,
                     int pos,
                     int max)
Establish a set of characters to dribble out


read

public int read(char[] cbuf,
                int off,
                int len)
         throws IOException
Dribble some characters. If we run out, we begin to dribble the fake word string.

Specified by:
read in class Reader
Throws:
IOException