public class BufferedInput extends AbstractInput
LinkedList
line buffer.Constructor and Description |
---|
BufferedInput(LinkedList<Line> buffer)
Constructor with linked list used as source of the input lines.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Performs a no-op as there are no underlying resources
|
boolean |
hasMoreLines()
Returns true if there are more lines to be read.
|
Line |
readLine()
Reads the next line.
|
String |
toMultiLineString()
Returns a multi-line representation of the lines in this buffer.
|
String |
toString()
Returns a list-like representation of the lines contained in this buffer.
|
iterator
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public BufferedInput(LinkedList<Line> buffer)
buffer
is NOT cloned, meaning that changes to the
buffer will also be reflected in this input device and vice versa.buffer
- the buffer to use as basis for this input devicepublic boolean hasMoreLines()
Input
public Line readLine()
Input
public String toString()
toMultiLineString()
instead.public String toMultiLineString()
LineUtil.toMultiLineString(List)
public void close()
Copyright © 2024. All rights reserved.