public class ReaderImpl extends RubyObjectWrapper implements Reader
rubyNode, runtime| Constructor and Description |
|---|
ReaderImpl(org.jruby.runtime.builtin.IRubyObject rubyNode) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
advance()
Advance to the next line by discarding the line at the front of the stack
|
java.lang.String |
getDir()
Get the name of the directory of the current file
|
java.lang.String |
getFile()
Get the name of the file of the current line.
|
int |
getLineno()
Get the 1-based offset of the current line.
|
int |
getLineNumber()
Get the 1-based offset of the current line.
|
boolean |
hasMoreLines()
Check whether there are any lines left to read.
|
boolean |
isNextLineEmpty()
Peek at the next line and check if it's empty (i.e., whitespace only)
This method Does not consume the line from the stack.
|
java.util.List<java.lang.String> |
lines() |
java.lang.String |
peekLine()
Peek at the next line of source data.
|
java.util.List<java.lang.String> |
peekLines(int lineCount)
Peek at the next multiple lines of source data.
|
java.lang.String |
read()
Get the remaining lines of source data joined as a String.
|
java.lang.String |
readLine()
Get the next line of source data.
|
java.util.List<java.lang.String> |
readLines()
Get the remaining lines of source data.
|
void |
restoreLine(java.lang.String line)
Push the String line onto the beginning of the Array of source data.
|
void |
restoreLines(java.util.List<java.lang.String> lines)
Push multiple lines onto the beginning of the Array of source data.
|
void |
terminate()
Public: Advance to the end of the reader, consuming all remaining lines
|
getBoolean, getInt, getList, getProperty, getRubyObject, getRubyProperty, getRuntime, getString, getSymbol, setRubyProperty, setString, setSymbol, toJava, toJavapublic int getLineno()
Readerpublic int getLineNumber()
ReadergetLineNumber in interface Readerpublic java.lang.String getFile()
Readerpublic java.lang.String getDir()
Readerpublic boolean hasMoreLines()
ReaderhasMoreLines in interface Readerpublic boolean isNextLineEmpty()
ReaderisNextLineEmpty in interface Readerpublic java.lang.String read()
Readerpublic java.util.List<java.lang.String> readLines()
Readerpublic java.lang.String readLine()
Readerpublic void restoreLine(java.lang.String line)
ReaderrestoreLine in interface Readerpublic void restoreLines(java.util.List<java.lang.String> lines)
ReaderrestoreLines in interface Readerpublic java.lang.String peekLine()
Readerpublic java.util.List<java.lang.String> peekLines(int lineCount)
Readerpublic boolean advance()
Reader