public class StringInput extends Object implements Input
Constructor and Description |
---|
StringInput(Iterable<? extends String> lines)
Constructor with lines.
|
StringInput(Iterator<? extends String> lines)
Constructor with lines.
|
StringInput(Stream<? extends String> lines)
Constructor with lines.
|
StringInput(String... lines)
Constructor with lines.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close underlying resources if any, as for instance the source file.
|
boolean |
hasMoreLines()
Returns true if there are more lines to be read.
|
Iterator<Line> |
iterator()
Returns an immutable iterator over all lines returned by this input
object.
|
Line |
readLine()
Reads the next line.
|
String |
toMultilineString() |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public StringInput(String... lines)
lines
- the lines for this inputpublic StringInput(Iterable<? extends String> lines)
lines
- the lines for this inputpublic StringInput(Stream<? extends String> lines)
lines
- the lines for this inputpublic StringInput(Iterator<? extends String> lines)
lines
- the lines for this inputpublic boolean hasMoreLines()
Input
hasMoreLines
in interface Input
public Line readLine()
Input
public Iterator<Line> iterator()
Input
public void close()
Input
close
in interface AutoCloseable
close
in interface Input
public String toMultilineString()
Copyright © 2024. All rights reserved.