org.acm.seguin.io
Class DirectoryTreeTraversal

java.lang.Object
  extended by org.acm.seguin.io.DirectoryTreeTraversal
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
BackupTraversal, CleanClassFiles, CodeStoreBuilder, JarDirectoryBuilder, JavadocBuilder, LCTraversal, PrettyPrinter, SummaryTraversal, UndoCleaner

public abstract class DirectoryTreeTraversal
extends java.lang.Object
implements java.lang.Runnable

Traverses a directory structure.

Author:
Chris Seguin

Constructor Summary
DirectoryTreeTraversal(java.lang.String init)
          Traverses a directory tree structure
 
Method Summary
protected  void arriveAtDir(java.io.File currentFile)
          Program called when we arrive at a directory
protected  boolean isAllowed(java.io.File currentDirectory)
          Gets the Allowed attribute of the DirectoryTreeTraversal object
protected abstract  boolean isTarget(java.io.File currentFile)
          Determines if this file should be handled by this traversal
protected  void leaveDir(java.io.File currentFile)
          Program called when we arrive at a directory
 void run()
          Starts the tree traversal
protected  void traverse(java.io.File current)
          Starts the tree traversal
protected abstract  void visit(java.io.File currentFile)
          Visits the current file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectoryTreeTraversal

public DirectoryTreeTraversal(java.lang.String init)
Traverses a directory tree structure

Parameters:
init - the initial directory
Method Detail

run

public void run()
Starts the tree traversal

Specified by:
run in interface java.lang.Runnable

isTarget

protected abstract boolean isTarget(java.io.File currentFile)
Determines if this file should be handled by this traversal

Parameters:
currentFile - the current file
Returns:
true if the file should be handled

isAllowed

protected boolean isAllowed(java.io.File currentDirectory)
Gets the Allowed attribute of the DirectoryTreeTraversal object

Parameters:
currentDirectory - Description of Parameter
Returns:
The Allowed value

traverse

protected void traverse(java.io.File current)
Starts the tree traversal

Parameters:
current - Description of Parameter

visit

protected abstract void visit(java.io.File currentFile)
Visits the current file

Parameters:
currentFile - the current file

arriveAtDir

protected void arriveAtDir(java.io.File currentFile)
Program called when we arrive at a directory

Parameters:
currentFile - the current file

leaveDir

protected void leaveDir(java.io.File currentFile)
Program called when we arrive at a directory

Parameters:
currentFile - the current file