public class DeepFileSet extends PeekIterator<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 Iterator<File> |
currentIterator |
protected Stack<File> |
paths |
protected Pattern |
wildcard |
closed, EMPTY, fetchedNextValue, next| Constructor and Description |
|---|
DeepFileSet(File folderPlusWildcard)
Constructs a DeepFileSet from a path that ends in a wildcard
|
DeepFileSet(File folder,
String wildcard)
Constructs a DeepFileSet from path and wildcard
|
DeepFileSet(String folderPlusWildcard)
Constructs a DeepFileSet from a path that ends in a wildcard
|
| Modifier and Type | Method and Description |
|---|---|
protected File |
internalNext()
Returns the next or NULL if no next element is available
|
static void |
main(String[] argv)
Test routine
|
Pattern |
patternForWildcard(String wildcard) |
protected boolean |
setIterator()
Pops a path, sets the iterator to the files in the path
|
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, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEachRemainingforEach, spliteratorprotected final Pattern wildcard
public DeepFileSet(File folderPlusWildcard)
public DeepFileSet(String folderPlusWildcard)
protected boolean setIterator()
protected File internalNext() throws Exception
PeekIteratorinternalNext in class PeekIterator<File>Exceptionpublic String toString()
toString in class PeekIterator<File>public static void main(String[] argv)
Copyright © 2018. All rights reserved.