ProGuard

proguard
Class WordReader

java.lang.Object
  extended byproguard.WordReader
Direct Known Subclasses:
ArgumentWordReader, FileWordReader

public abstract class WordReader
extends Object

An abstract reader of words, with the possibility to include other readers. Words are separated by spaces or broken off at delimiters. Words containing spaces or delimiters can be quoted with single or double quotes. Comments (everything starting with '#' on a single line) are ignored.


Constructor Summary
WordReader()
           
 
Method Summary
 void includeWordReader(WordReader newIncludeWordReader)
          Specifies to start reading words from the given WordReader.
 String lastComments()
          Returns the comments collected before returning the last word.
protected abstract  String lineLocationDescription()
          Constructs a readable description of the current WordReader position.
 String locationDescription()
          Constructs a readable description of the current position in this WordReader and its included WordReader objects.
protected abstract  String nextLine()
          Reads a line from this WordReader, or from one of its active included WordReader objects.
 String nextWord()
          Reads a word from this WordReader, or from one of its active included WordReader objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WordReader

public WordReader()
Method Detail

includeWordReader

public void includeWordReader(WordReader newIncludeWordReader)
Specifies to start reading words from the given WordReader. When it is exhausted, this WordReader will continue to provide its own words.

Parameters:
newIncludeWordReader - the WordReader that will start reading words.

nextWord

public String nextWord()
                throws IOException
Reads a word from this WordReader, or from one of its active included WordReader objects.

Returns:
the read word.
Throws:
IOException

lastComments

public String lastComments()
                    throws IOException
Returns the comments collected before returning the last word. Starts collecting new comments.

Returns:
the collected comments, or null if there weren't any.
Throws:
IOException

locationDescription

public String locationDescription()
Constructs a readable description of the current position in this WordReader and its included WordReader objects.

Returns:
the description.

nextLine

protected abstract String nextLine()
                            throws IOException
Reads a line from this WordReader, or from one of its active included WordReader objects.

Returns:
the read line.
Throws:
IOException

lineLocationDescription

protected abstract String lineLocationDescription()
Constructs a readable description of the current WordReader position.

Returns:
the description.

ProGuard