br.com.objectos.fs
Class SimplePathNameVisitor<R,P>

java.lang.Object
  extended by br.com.objectos.fs.SimplePathNameVisitor<R,P>
Type Parameters:
R - the type of the result of the visit operation
P - the type of the additional value
All Implemented Interfaces:
PathNameVisitor<R,P>

public class SimplePathNameVisitor<R,P>
extends Object
implements PathNameVisitor<R,P>

A simple visitor of PathName instances.

Since:
2

Constructor Summary
SimplePathNameVisitor()
           
 
Method Summary
protected  R defaultAction(PathName pathName, P p)
          The default action for visit methods.
 R visitDirectory(Directory directory, P p)
          Visits a directory.
 R visitNotFound(ResolvedPath notFound, P p)
          Visits a nonexistent file.
 R visitRegularFile(RegularFile file, P p)
          Visits a regular file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimplePathNameVisitor

public SimplePathNameVisitor()
Method Detail

visitDirectory

public R visitDirectory(Directory directory,
                        P p)
                 throws IOException
Visits a directory.

Specified by:
visitDirectory in interface PathNameVisitor<R,P>
Parameters:
directory - the directory instance
p - an additional value
Returns:
the result of the visit operation
Throws:
IOException - if an I/O error occurs

visitNotFound

public R visitNotFound(ResolvedPath notFound,
                       P p)
                throws IOException
Visits a nonexistent file.

Specified by:
visitNotFound in interface PathNameVisitor<R,P>
Parameters:
notFound - the nonexistent file
p - an additional value
Returns:
the result of the visit operation
Throws:
IOException - if an I/O error occurs

visitRegularFile

public R visitRegularFile(RegularFile file,
                          P p)
                   throws IOException
Visits a regular file.

Specified by:
visitRegularFile in interface PathNameVisitor<R,P>
Parameters:
file - the regular file
p - an additional value
Returns:
the result of the visit operation
Throws:
IOException - if an I/O error occurs

defaultAction

protected R defaultAction(PathName pathName,
                          P p)
                   throws IOException
The default action for visit methods.

Parameters:
pathName - the path name to process
p - an additional value
Returns:
null unless overridden
Throws:
IOException - may be thrown if overridden


Copyright © 2021 Objectos Software LTDA. All rights reserved.