diff options
author | Lukas Rytz <lukas.rytz@typesafe.com> | 2014-12-18 16:42:07 +0100 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@typesafe.com> | 2014-12-18 16:42:07 +0100 |
commit | 76eac6015a16ba4d193616e265d4ac32dfa49082 (patch) | |
tree | 6066d3f1dbd586fa7383a5e82ccdb2f221081b4b /src/library | |
parent | c924a6452a39f03c39dfca51dca70764745e19cb (diff) | |
parent | 5343c136e58080d72ec12a6820a0e90ac85b9a08 (diff) | |
download | scala-76eac6015a16ba4d193616e265d4ac32dfa49082.tar.gz scala-76eac6015a16ba4d193616e265d4ac32dfa49082.tar.bz2 scala-76eac6015a16ba4d193616e265d4ac32dfa49082.zip |
Merge pull request #4191 from som-snytt/issue/8538
SI-8538 Test or example for Source.report
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/io/Source.scala | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/library/scala/io/Source.scala b/src/library/scala/io/Source.scala index 74c3e06839..9f0b56b4fe 100644 --- a/src/library/scala/io/Source.scala +++ b/src/library/scala/io/Source.scala @@ -169,9 +169,20 @@ object Source { createBufferedSource(is, reset = () => fromInputStream(is)(codec), close = () => is.close())(codec) } -/** The class `Source` implements an iterable representation of source data. - * Calling method `reset` returns an identical, resetted source, where - * possible. +/** An iterable representation of source data. + * It may be reset with the optional `reset` method. + * + * Subclasses must supply [[scala.io.Source@iter the underlying iterator]]. + * + * Error handling may be customized by overriding the [[scala.io.Source@report report]] method. + * + * The [[scala.io.Source@ch current input]] and [[scala.io.Source@pos position]], + * as well as the [[scala.io.Source@next next character]] methods delegate to + * [[scala.io.Source$Positioner the positioner]]. + * + * The default positioner encodes line and column numbers in the position passed to `report`. + * This behavior can be changed by supplying a + * [[scala.io.Source@withPositioning(pos:Source.this.Positioner):Source.this.type custom positioner]]. * * @author Burak Emir * @version 1.0 |