public abstract class WordReader
extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
protected |
WordReader(java.io.File baseDir)
Creates a new WordReader with the given base directory.
|
protected |
WordReader(java.net.URL baseURL)
Creates a new WordReader with the given base URL.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the FileWordReader.
|
java.io.File |
getBaseDir()
Returns the base directory of this reader, if any.
|
java.net.URL |
getBaseURL()
Returns the base URL of this reader, if any.
|
void |
includeWordReader(WordReader newIncludeWordReader)
Specifies to start reading words from the given WordReader.
|
java.lang.String |
lastComments()
Returns the comments collected before returning the last word.
|
protected abstract java.lang.String |
lineLocationDescription()
Returns a readable description of the current WordReader position.
|
java.lang.String |
locationDescription()
Constructs a readable description of the current position in this
WordReader and its included WordReader objects.
|
protected abstract java.lang.String |
nextLine()
Reads a line from this WordReader, or from one of its active included
WordReader objects.
|
java.lang.String |
nextWord(boolean isFileName,
boolean expectSingleFile)
Reads a word from this WordReader, or from one of its active included
WordReader objects.
|
void |
setBaseDir(java.io.File baseDir)
Sets the base directory of this reader.
|
protected WordReader(java.io.File baseDir)
protected WordReader(java.net.URL baseURL)
public void setBaseDir(java.io.File baseDir)
public java.io.File getBaseDir()
public java.net.URL getBaseURL()
public void includeWordReader(WordReader newIncludeWordReader)
newIncludeWordReader - the WordReader that will start reading words.public java.lang.String nextWord(boolean isFileName,
boolean expectSingleFile)
throws java.io.IOException
isFileName - return a complete line (or argument), if the word
isn't an option (it doesn't start with '-').expectSingleFile - if true, the remaining line is expected to be a
single file name (excluding path separator),
otherwise multiple files might be specified
using the path separator.java.io.IOExceptionpublic java.lang.String lastComments()
throws java.io.IOException
null if there weren't any.java.io.IOExceptionpublic java.lang.String locationDescription()
protected abstract java.lang.String nextLine()
throws java.io.IOException
java.io.IOExceptionprotected abstract java.lang.String lineLocationDescription()
public void close()
throws java.io.IOException
java.io.IOException