public class DeepFileSet extends PeekIterator<java.io.File>
for(File f : new DeepFileSet("c:\\myfiles","*.jaVa"))
System.out.println(f);
-->
c:\myfiles\FileSet.java
c:\myfiles\HTMLReader.java
c:\myfiles\mysubfolder\OtherFile.java
...
PeekIterator.ElementaryPeekIterator<T>, PeekIterator.SimplePeekIterator<T>| Modifier and Type | Field and Description |
|---|---|
protected java.util.Iterator<java.io.File> |
currentIterator |
protected java.util.Stack<java.io.File> |
paths |
protected java.util.regex.Pattern |
wildcard |
closed, EMPTY, initialized, next| Constructor and Description |
|---|
DeepFileSet(java.io.File folderPlusWildcard)
Constructs a DeepFileSet from a path that ends in a wildcard
|
DeepFileSet(java.io.File folder,
java.lang.String wildcard)
Constructs a DeepFileSet from path and wildcard
|
DeepFileSet(java.lang.String folderPlusWildcard)
Constructs a DeepFileSet from a path that ends in a wildcard
|
| Modifier and Type | Method and Description |
|---|---|
protected java.io.File |
internalNext()
Returns the next or NULL if no next element is available
|
static void |
main(java.lang.String[] argv)
Test routine
|
java.util.regex.Pattern |
patternForWildcard(java.lang.String wildcard) |
protected boolean |
setIterator()
Pops a path, sets the iterator to the files in the path
|
java.lang.String |
toString()
Returns the current state of this DeepFileSet
|
asList, asList, asSet, asSet, asSet, close, emptyIterator, hasNext, internalSilentNext, iterator, list, list, next, nextOrNull, numElements, numElements, peek, remove, toString, toStringprotected final java.util.Stack<java.io.File> paths
protected final java.util.regex.Pattern wildcard
protected java.util.Iterator<java.io.File> currentIterator
public DeepFileSet(java.io.File folderPlusWildcard)
public DeepFileSet(java.lang.String folderPlusWildcard)
public DeepFileSet(java.io.File folder,
java.lang.String wildcard)
public java.util.regex.Pattern patternForWildcard(java.lang.String wildcard)
protected boolean setIterator()
protected java.io.File internalNext()
throws java.lang.Exception
PeekIteratorinternalNext in class PeekIterator<java.io.File>java.lang.Exceptionpublic java.lang.String toString()
toString in class PeekIterator<java.io.File>public static void main(java.lang.String[] argv)