Scala Library
|
|
scala/io/Source.scala
]
abstract
class
Source
extends
Iterator[Char]Source
implements an iterable representation
of source data. Calling method reset
returns an identical,
resetted source, where possible.Value Summary | |
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 |
Method Summary | |
def
|
ch : Char |
def
|
close
: Unit
The close() method closes the underlying resource.
|
def
|
getLine
(line : Int) : java.lang.String
convenience method, returns given line (not including newline)
from Source.
|
def
|
getLines
(separator : java.lang.String) : Iterator[java.lang.String]
returns an iterator who returns lines (NOT including newline character(s)).
If no separator is given, the platform-specific value "line.separator" is used.
a line ends in \r, \n, or \r\n.
|
def
|
hasNext
: Boolean
Returns
true if this source has more characters. |
def
|
next
: Char
Returns next character.
|
def
|
pos : Int |
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 |
def
|
reset
: Source
The reset() method creates a fresh copy of this Source.
|
def
|
withClose (f : () => Unit) : Source |
def
|
withDescription (text : java.lang.String) : Source |
def
|
withPositioning (on : Boolean) : Source |
def
|
withReset (f : () => Source) : Source |
Methods inherited from Iterator | |
take, drop, slice, map, ++, flatMap, filter, filterNot, partialMap, takeWhile, partition, dropWhile, zip, padTo, zipWithIndex, zipAll, foreach, forall, exists, contains, find, indexWhere, indexOf, foldLeft, foldRight, /:, :\, reduceLeft, reduceRight, reduceLeftOption, reduceRightOption, buffered, grouped, sliding, length, duplicate, patch, copyToArray, copyToArray, copyToArray, copyToBuffer, toList, toStream, toSeq, 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 |
Class Summary | |
class
|
LineIterator
(separator : java.lang.String) extends Iterator[java.lang.String]
|
class
|
Positioner
extends AnyRef
|
Object Summary | |
object
|
NoPositioner
extends Positioner
|
Value Details |
var
descr : java.lang.String
var
nerrors : Int
var
nwarnings : Int
Method Details |
def
getLine(line : Int) : java.lang.String
line -
the line index, first line is 1
def
getLines(separator : java.lang.String) : Iterator[java.lang.String]
def
hasNext : Boolean
true
if this source has more characters.
def
next : Char
def
ch : Char
def
pos : Int
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
)
def
withDescription(text : java.lang.String) : Source
def
close : Unit
def
reset : Source
Scala Library
|
|