程序包 proguard
类 WordReader
- java.lang.Object
-
- proguard.WordReader
-
- 直接已知子类:
ArgumentWordReader,LineWordReader
public abstract class WordReader extends java.lang.ObjectAn 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.
-
-
构造器概要
构造器 限定符 构造器 说明 protectedWordReader(java.io.File baseDir)Creates a new WordReader with the given base directory.protectedWordReader(java.net.URL baseURL)Creates a new WordReader with the given base URL.
-
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 voidclose()Closes the FileWordReader.java.io.FilegetBaseDir()Returns the base directory of this reader, if any.java.net.URLgetBaseURL()Returns the base URL of this reader, if any.voidincludeWordReader(WordReader newIncludeWordReader)Specifies to start reading words from the given WordReader.java.lang.StringlastComments()Returns the comments collected before returning the last word.protected abstract java.lang.StringlineLocationDescription()Returns a readable description of the current WordReader position.java.lang.StringlocationDescription()Constructs a readable description of the current position in this WordReader and its included WordReader objects.protected abstract java.lang.StringnextLine()Reads a line from this WordReader, or from one of its active included WordReader objects.java.lang.StringnextWord(boolean isFileName, boolean expectSingleFile)Reads a word from this WordReader, or from one of its active included WordReader objects.voidsetBaseDir(java.io.File baseDir)Sets the base directory of this reader.
-
-
-
方法详细资料
-
setBaseDir
public void setBaseDir(java.io.File baseDir)
Sets the base directory of this reader.
-
getBaseDir
public java.io.File getBaseDir()
Returns the base directory of this reader, if any.
-
getBaseURL
public java.net.URL getBaseURL()
Returns the base URL of this reader, if any.
-
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.- 参数:
newIncludeWordReader- the WordReader that will start reading words.
-
nextWord
public java.lang.String nextWord(boolean isFileName, boolean expectSingleFile) throws java.io.IOExceptionReads a word from this WordReader, or from one of its active included WordReader objects.- 参数:
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.- 返回:
- the read word.
- 抛出:
java.io.IOException
-
lastComments
public java.lang.String lastComments() throws java.io.IOExceptionReturns the comments collected before returning the last word. Starts collecting new comments.- 返回:
- the collected comments, or
nullif there weren't any. - 抛出:
java.io.IOException
-
locationDescription
public java.lang.String locationDescription()
Constructs a readable description of the current position in this WordReader and its included WordReader objects.- 返回:
- the description.
-
nextLine
protected abstract java.lang.String nextLine() throws java.io.IOExceptionReads a line from this WordReader, or from one of its active included WordReader objects.- 返回:
- the read line.
- 抛出:
java.io.IOException
-
lineLocationDescription
protected abstract java.lang.String lineLocationDescription()
Returns a readable description of the current WordReader position.- 返回:
- the description.
-
close
public void close() throws java.io.IOExceptionCloses the FileWordReader.- 抛出:
java.io.IOException
-
-