|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.faunos.util.io.file.Traverser
public class Traverser
A depth-first, directory structure traverser. The traverser implements an Euler traversal of the directory structure (generalized for tree nodes with arbitrary number of children). As it traverses the structure, an instance fires pre-order and post-order events along the way.
This class is not safe under concurrent access.
TraverseListener
,
Euler
Traversal
Constructor Summary | |
---|---|
Traverser(File root)
Creates a new instance with the given root file (usually a directory). |
|
Traverser(File root,
TraverseListener listener,
FileFilter filter,
Comparator<File> siblingOrder)
Creates a new instance with the given root file (usually a directory). |
Method Summary | |
---|---|
void |
run()
Performs the traversal over the directory structure. |
void |
setFilter(FileFilter filter)
Sets the filter used to determine whether files will be visited. |
void |
setListener(TraverseListener listener)
Sets the listener for the traversal. |
void |
setSiblingOrder(Comparator<File> siblingOrder)
Sets the comparator used to determine the order in which files in a same directory get visited. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Traverser(File root)
public Traverser(File root, TraverseListener listener, FileFilter filter, Comparator<File> siblingOrder)
Method Detail |
---|
public void setListener(TraverseListener listener)
public void setFilter(FileFilter filter)
public void setSiblingOrder(Comparator<File> siblingOrder)
public void run()
run
in interface Runnable
IndexOutOfBoundsException
- if invoked more than once
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |