|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectappli.diff.ASStreamIterator
Local class reading the input file and returning the lines. Suppress all empty lines if NO_EMPTY_LINES is true. The line counter returns BEFORE a nextLine() is returned its line number. If empty lines are not returned, the counter returns the number of the next non empty line.
Field Summary | |
(package private) int |
currCount
|
(package private) java.lang.String |
currLine
|
(package private) boolean |
hasmorelines
|
(package private) int |
lineCounter
|
(package private) int |
lineNumber
|
(package private) boolean |
NO_EMPTY_LINES
|
(package private) java.io.BufferedReader |
rdr
|
Constructor Summary | |
ASStreamIterator(java.io.File f)
Create an input stream from a File object |
|
ASStreamIterator(java.io.InputStream in)
Create an input stream interator from an input stream |
|
ASStreamIterator(java.lang.String str)
Create an input stream from a string |
Method Summary | |
int |
getLineCount()
Get line counter |
boolean |
hasMoreLines()
returns true if the stream has still lines to read |
private void |
init()
Ini |
java.lang.String |
nextLine()
returns the next line from the file |
private void |
readNextLine()
read the next line.Prepares the variables for nextLine() and hasMoreLines() |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
boolean NO_EMPTY_LINES
java.io.BufferedReader rdr
java.lang.String currLine
int currCount
int lineCounter
int lineNumber
boolean hasmorelines
Constructor Detail |
public ASStreamIterator(java.io.InputStream in) throws java.io.IOException
in
- InputStream file
java.io.IOException
- if IO errorspublic ASStreamIterator(java.io.File f) throws java.io.IOException
f
- File object
java.io.IOException
- if IO errorspublic ASStreamIterator(java.lang.String str) throws java.io.IOException
str
- a String containing a source file to beautify
java.io.IOException
- if IOError while initilizinf the BufferedReaderMethod Detail |
private void init() throws java.io.IOException
java.io.IOException
public boolean hasMoreLines()
hasMoreLines
in interface ASSourceIterator
public java.lang.String nextLine() throws java.io.IOException
nextLine
in interface ASSourceIterator
java.io.IOException
- in case of IO errorprivate void readNextLine() throws java.io.IOException
java.io.IOException
- in case of IO errorpublic int getLineCount()
getLineCount
in interface ASSourceIterator
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |