org.cdlib.xtf.util
Class FastStringReader

Object
  extended by Reader
      extended by StringReader
          extended by FastStringReader
All Implemented Interfaces:
Closeable, Readable

public class FastStringReader
extends StringReader

Used to bypass the slowness of a Lucene StringReader (but only when used in conjuction with a FastTokenizer).

Author:
Martin Haye

Field Summary
private  String str
          The actual string to read from
 
Fields inherited from class Reader
lock
 
Constructor Summary
FastStringReader(Reader reader)
          Wrap a normal reader with a fast string reader
FastStringReader(String s)
          Construct a reader for the given string
 
Method Summary
 String getString()
          Get the string back
static String readerToString(Reader reader)
          Read all the characters from a Reader, and return the resulting concatenated string.
 
Methods inherited from class StringReader
close, mark, markSupported, read, read, ready, reset, skip
 
Methods inherited from class Reader
read, read
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

str

private String str
The actual string to read from

Constructor Detail

FastStringReader

public FastStringReader(String s)
Construct a reader for the given string


FastStringReader

public FastStringReader(Reader reader)
Wrap a normal reader with a fast string reader

Method Detail

readerToString

public static String readerToString(Reader reader)
Read all the characters from a Reader, and return the resulting concatenated string.


getString

public String getString()
Get the string back