Class PathFinder.Primary

  • Enclosing class:
    PathFinder

    static class PathFinder.Primary
    extends PathFinder
    The most basic kind of finder: Method PathFinder.path(Path) returns an instance of this. next() returns the given file and, if this is a folder all files therein.
    • Field Detail

      • files

        private final Stack<Path> files
        The list of files to be returned by next() unwrapping folders recursively.
    • Constructor Detail

      • Primary

        Primary​(Path file)
        Pushes file to files.
      • Primary

        Primary​(Path[] path)
    • Method Detail

      • next

        public Path next()
        If the topmost entry of files is no folder, this is returned as is. otherwise, in addition, this folder is unwrapped and the contents is pushed onto the stack files.
        Specified by:
        next in class PathFinder