diff options
author | Adriaan Moors <adriaan@lightbend.com> | 2017-02-07 17:42:49 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-07 17:42:49 -0800 |
commit | 8035fb298e5075441b3c87f73183183ec30d972d (patch) | |
tree | d98dfae522d16e33d0006eda80be246b1f299f76 | |
parent | 8038924acb9326ee8378b8dd916e2d74e388878d (diff) | |
parent | c2356bed162c4720888d17eade7c39d96f54916e (diff) | |
download | scala-8035fb298e5075441b3c87f73183183ec30d972d.tar.gz scala-8035fb298e5075441b3c87f73183183ec30d972d.tar.bz2 scala-8035fb298e5075441b3c87f73183183ec30d972d.zip |
Merge pull request #5628 from martijnhoekstra/walkfilterdoc
fix doc for walkfilter and walk
-rw-r--r-- | src/reflect/scala/reflect/io/Path.scala | 13 |
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) |