public class StringInput extends java.lang.Object implements Input
| Constructor and Description |
|---|
StringInput(java.lang.Iterable<? extends java.lang.String> lines)
Constructor with lines.
|
StringInput(java.util.Iterator<? extends java.lang.String> lines)
Constructor with lines.
|
StringInput(java.util.stream.Stream<? extends java.lang.String> lines)
Constructor with lines.
|
StringInput(java.lang.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.
|
java.util.Iterator<Line> |
iterator()
Returns an immutable iterator over all lines returned by this input
object.
|
Line |
readLine()
Reads the next line.
|
java.lang.String |
toMultilineString() |
java.lang.String |
toString() |
public StringInput(java.lang.String... lines)
lines - the lines for this inputpublic StringInput(java.lang.Iterable<? extends java.lang.String> lines)
lines - the lines for this inputpublic StringInput(java.util.stream.Stream<? extends java.lang.String> lines)
lines - the lines for this inputpublic StringInput(java.util.Iterator<? extends java.lang.String> lines)
lines - the lines for this inputpublic boolean hasMoreLines()
InputhasMoreLines in interface Inputpublic Line readLine()
Inputpublic java.util.Iterator<Line> iterator()
Inputpublic void close()
Inputpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toMultilineString()
Copyright © 2021. All Rights Reserved.