vfs
Interface VFSVisitor


public interface VFSVisitor

A VFSVisitor executes an algorithm with files and directories while being escorted through a virtual file system.

This is a Visitor interface in a Visitor design pattern whose ObjectStructure class is a VFSRoot. In addition to normal Visitor methods, it adds methods start() and finish(). The start() method allows a VFSVisitor to perfom multiple traversals through different virtual file systems. The finish() method() can be implemented to perform any algorithm steps that are required after all files and subdirectories have been visited.


Method Summary
 void enter(VFSDirectory d)
          v.enter(d) performs algorithm steps required when v is escorted into the directory d.
 void finish()
          v.finish() performs algorithm steps required when a traversal with v is finished.
 void leave(VFSDirectory d)
          v.leave(d) performs algorithm steps required when v is escorted out of the directory d.
 void start()
          v.start() performs algorithm initialization steps required when a new traversal is started with v.
 void visit(VFSFile f)
          v.visit(f) performs algorithm steps required when v is escorted to the file f.
 

Method Detail

start

void start()
v.start() performs algorithm initialization steps required when a new traversal is started with v.


enter

void enter(VFSDirectory d)
v.enter(d) performs algorithm steps required when v is escorted into the directory d.

Parameters:
d - the directory being entered

leave

void leave(VFSDirectory d)
v.leave(d) performs algorithm steps required when v is escorted out of the directory d.

Parameters:
d - the directory being left

visit

void visit(VFSFile f)
v.visit(f) performs algorithm steps required when v is escorted to the file f.

Parameters:
f - the file being visited

finish

void finish()
v.finish() performs algorithm steps required when a traversal with v is finished.