summaryrefslogtreecommitdiff
path: root/src/reflect/scala/reflect
diff options
context:
space:
mode:
authorMartijn Hoekstra <MartijnHoekstra@gmail.com>2017-01-05 21:04:25 +0100
committerMartijn Hoekstra <MartijnHoekstra@gmail.com>2017-01-05 21:04:25 +0100
commitc2356bed162c4720888d17eade7c39d96f54916e (patch)
tree3e6c058a8fde886ce0b9e46d5f2b1e2696e91b5e /src/reflect/scala/reflect
parentc94a9b291916172c594ed833ab2738b80a3652b7 (diff)
downloadscala-c2356bed162c4720888d17eade7c39d96f54916e.tar.gz
scala-c2356bed162c4720888d17eade7c39d96f54916e.tar.bz2
scala-c2356bed162c4720888d17eade7c39d96f54916e.zip
fix doc for walkfilter and walk
Diffstat (limited to 'src/reflect/scala/reflect')
-rw-r--r--src/reflect/scala/reflect/io/Path.scala13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/reflect/scala/reflect/io/Path.scala b/src/reflect/scala/reflect/io/Path.scala
index 5f93506015..c5b5ae24ba 100644
--- a/src/reflect/scala/reflect/io/Path.scala
+++ b/src/reflect/scala/reflect/io/Path.scala
@@ -107,19 +107,20 @@ class Path private[io] (val jfile: JFile) {
def /(child: Directory): Directory = /(child: Path).toDirectory
def /(child: File): File = /(child: Path).toFile
- /** If this path is a container, recursively iterate over its contents.
+ /** If this path is a directory, recursively iterate over its contents.
* The supplied condition is a filter which is applied to each element,
- * with that branch of the tree being closed off if it is true. So for
- * example if the condition is true for some subdirectory, nothing
- * under that directory will be in the Iterator; but otherwise each
- * file and subdirectory underneath it will appear.
+ * with that branch of the tree being closed off if it is false.
+ * So for example if the condition is false for some subdirectory, nothing
+ * under that directory will be in the Iterator. If it's true, all files for
+ * which the condition holds and are directly in that subdirectory are in the
+ * Iterator, and all sub-subdirectories are recursively evaluated
*/
def walkFilter(cond: Path => Boolean): Iterator[Path] =
if (isFile) toFile walkFilter cond
else if (isDirectory) toDirectory walkFilter cond
else Iterator.empty
- /** Equivalent to walkFilter(_ => false).
+ /** Equivalent to walkFilter(_ => true).
*/
def walk: Iterator[Path] = walkFilter(_ => true)