Scala Library
|
|
scala/io/Source.scala
]
abstract
class
Source
extends
Iterator[Char]Source
implements an iterable representation
of source files. Calling method reset
returns an identical,
resetted source.Value Summary | |
protected var
|
ccol : Int |
var
|
ch
: Char
the last character returned by next.
the value before the first call to next is undefined.
|
protected var
|
cline : Int |
var
|
descr
: java.lang.String
description of this source, default empty
|
protected abstract val
|
iter
: Iterator[Char]
the actual iterator
|
var
|
nerrors : Int |
var
|
nwarnings : Int |
var
|
pos
: Int
position of last character returned by next
|
var
|
tabinc
: Int
default col increment for tabs '\t', set to 4 initially
|
Method Summary | |
def
|
getLine
(line : Int) : java.lang.String
convenience method, returns given line (not including newline)
from Source.
|
def
|
getLines
: Iterator[java.lang.String]
returns an iterator who returns lines (including newline character).
a line ends in \n.
|
def
|
hasNext
: Boolean
Returns
true if this source has more characters. |
def
|
next
: Char
returns next character and has the following side-effects: updates
position (ccol and cline) and assigns the character to ch
|
def
|
report (pos : Int, msg : java.lang.String, out : java.io.PrintStream) : Unit |
def
|
reportError
(pos : Int, msg : java.lang.String, out : java.io.PrintStream) : Unit
Reports an error message to the output stream
out . |
def
|
reportWarning (pos : Int, msg : java.lang.String, out : java.io.PrintStream) : Unit |
abstract def
|
reset
: Source
The reset() method creates a fresh copy of this Source.
|
Methods inherited from Iterator | |
take, drop, slice, map, ++, flatMap, filter, takeWhile, partition, dropWhile, zip, padTo, zipWithIndex, zipAll, foreach, forall, exists, contains, find, indexWhere, indexOf, foldLeft, foldRight, /:, :\, reduceLeft, reduceRight, reduceLeftOpt, reduceRightOpt, buffered, length, duplicate, patch, copyToArray, copyToArray, copyToArray, copyToBuffer, toList, toStream, toSequence, mkString, mkString, mkString, addString, addString, addString, toString, append, findIndexOf, collect, counted, readInto, readInto, readInto |
Methods inherited from AnyRef | |
getClass, hashCode, equals, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized |
Methods inherited from Any | |
==, !=, isInstanceOf, asInstanceOf |
Value Details |
protected
var
cline : Int
protected
var
ccol : Int
var
pos : Int
var
ch : Char
var
descr : java.lang.String
var
nerrors : Int
var
nwarnings : Int
var
tabinc : Int
Method Details |
def
getLine(line : Int) : java.lang.String
line -
the line index, first line is 1scala.compat.Platform.IllegalArgumentException -
def
getLines : Iterator[java.lang.String]
def
hasNext : Boolean
true
if this source has more characters.
def
next : Char
def
reportError(pos : Int, msg : java.lang.String, out : java.io.PrintStream) : Unit
out
.pos -
the source position (line/column)msg -
the error message to reportout -
PrintStream to use (optional: defaults to Console.err
)
def
report(pos : Int, msg : java.lang.String, out : java.io.PrintStream) : Unit
pos -
the source position (line/column)msg -
the error message to reportout -
PrintStream to use
def
reportWarning(pos : Int, msg : java.lang.String, out : java.io.PrintStream) : Unit
pos -
the source position (line/column)msg -
the warning message to reportout -
PrintStream to use (optional: defaults to Console.out
)abstract
def
reset : Source
Scala Library
|
|