scala.io
class Source

[source: `scala/io/Source.scala`]

`abstract` `class` Source
  `extends` Iterator[Char]

  The class `Source` implements an iterable representation of source files. Calling method `reset` returns an identical, resetted source.

Author
  Burak Emir
Version
  1.0

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 : 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) : String convenience method, returns given line (not including newline) from Source.
`def` | getLines : Iterator[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 : String, out : PrintStream) : Unit
`def` | reportError (pos : Int, msg : String, out : PrintStream) : Unit Reports an error message to the output stream `out`.
`def` | reportError (pos : Int, msg : String) : Unit Reports an error message to console.
`def` | reportWarning (pos : Int, msg : String, out : PrintStream) : Unit
`def` | reportWarning (pos : Int, msg : String) : Unit Reports a warning message to `java.lang.System.out`.
`abstract def` | reset : Source the actual reset method

Methods inherited from Iterator
take, drop, map, append, ++, flatMap, filter, takeWhile, dropWhile, zip, zipWithIndex, foreach, forall, exists, contains, find, foldLeft, foldRight, /:, :\, reduceLeft, reduceRight, buffered, counted, duplicate, copyToArray, readInto, readInto, readInto, copyToBuffer, toList, mkString, mkString, addString, toString

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 abstract` `val` iter : Iterator[Char]

  the actual iterator

`protected` `var` cline : Int

`protected` `var` ccol : Int

`` `var` pos : Int

  position of last character returned by next

`` `var` ch : Char

  the last character returned by next. the value before the first call to next is undefined.

`` `var` descr : String

  description of this source, default empty

`` `var` nerrors : Int

`` `var` nwarnings : Int

`` `var` tabinc : Int

  default col increment for tabs '\t', set to 4 initially

Method Details

`` `def` getLine(line : Int) : String

  convenience method, returns given line (not including newline) from Source.

Parameters
  `line -` the line index.
Returns
  the character string of the specified line.
Throws
  `scala.compat.Platform.IllegalArgumentException -`

`` `def` getLines : Iterator[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.

Overrides
  Iterator.hasNext

`` `def` next : Char

  returns next character and has the following side-effects: updates position (ccol and cline) and assigns the character to ch

Overrides
  Iterator.next

`` `def` reportError(pos : Int, msg : String) : Unit

  Reports an error message to console.

Parameters
  `pos -` ...
  `msg -` the error message to report

`` `def` reportError(pos : Int, msg : String, out : PrintStream) : Unit

  Reports an error message to the output stream `out`.

Parameters
  `pos -` ...
  `msg -` the error message to report
  `out -` ...

`` `def` report(pos : Int, msg : String, out : PrintStream) : Unit

Parameters
  `pos -` ...
  `msg -` the error message to report
  `out -` ...

`` `def` reportWarning(pos : Int, msg : String) : Unit

  Reports a warning message to `java.lang.System.out`.

Parameters
  `pos -` ...
  `msg -` the warning message to report

`` `def` reportWarning(pos : Int, msg : String, out : PrintStream) : Unit

Parameters
  `pos -` ...
  `msg -` the warning message to report
  `out -` ...

`abstract` `def` reset : Source

  the actual reset method