public abstract class WordReader extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
WordReader(File baseDir)
Creates a new WordReader with the given base directory.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the FileWordReader.
|
File |
getBaseDir()
Returns the base directory of this reader, if any.
|
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()
Returns 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(boolean isFileName)
Reads a word from this WordReader, or from one of its active included
WordReader objects.
|
void |
setBaseDir(File baseDir)
Sets the base directory of this reader.
|
protected WordReader(File baseDir)
public void setBaseDir(File baseDir)
public File getBaseDir()
public void includeWordReader(WordReader newIncludeWordReader)
newIncludeWordReader - the WordReader that will start reading words.public String nextWord(boolean isFileName) throws IOException
isFileName - return a complete line (or argument), if the word
isn't an option (it doesn't start with '-').IOExceptionpublic String lastComments() throws IOException
null if there weren't any.IOExceptionpublic String locationDescription()
protected abstract String nextLine() throws IOException
IOExceptionprotected abstract String lineLocationDescription()
public void close()
throws IOException
IOExceptionCopyright © 2015. All Rights Reserved.