|
Sharkysoft home | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--lava.io.LineEnumeration
Converts a Reader into an Enumeration of lines.
Details: LineEnumeration
is a wrapper class for BufferedReader
that converts the Reader
's lines into a standard Enumeration
. Each line is served as one Object
in the Enumeration
. An instance of this class can be supplied to any method in any other class that expects an Enumeration
. The Enumeration
continues until the Reader
's EOS (end of stream) has been reach. When the EOS is reached, LineEnumeration
automatically closes the underlying stream.
lava.util.Enumeration
,
lava.io.BufferedReader
Constructor Summary | |
LineEnumeration(java.io.BufferedReader in)
Specifies the base Reader. |
Method Summary | |
java.io.IOException |
getError()
Returns ioe . |
boolean |
hasMoreElements()
Synonym for hasMoreLines . |
boolean |
hasMoreLines()
Indicates whether this Enumeration has more elements. |
java.lang.Object |
nextElement()
Returns the next element. |
java.lang.String |
nextLine()
Returns the next line. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LineEnumeration(java.io.BufferedReader in)
Details: This constructor initializes a new instance with in
as the base Reader.
in
- the base streamMethod Detail |
public boolean hasMoreLines()
Enumeration
has more elements.
Details: hasMoreLines
returns true
if there is at least one more line to consume from this Enumeration
, false
otherwise.
true
iff there are more lines to consumepublic java.lang.String nextLine()
Details: nextLine
fetches and returns the next line from this Enumeration
. If there are no more lines, nextLine
returns null
.
public boolean hasMoreElements()
hasMoreLines
.
Details: hasMoreElements
is a synonym for hasMoreLines
. This synonym is included to satisfy the Enumeration
interface.
hasMoreElements
in interface java.util.Enumeration
hasMoreLines
public java.lang.Object nextElement()
Details: nextElement
is identical in function to nextLine
, with the exception that if there is no next line, it throws a NoSuchElementException
instead of returning null
. The returned Object
is guaranteed to be a String
.
nextElement
in interface java.util.Enumeration
public java.io.IOException getError()
ioe
.
Details: getError
returns ioe
.
ioe
|
Sharkysoft home | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |