Package dk.netarkivet.common.utils
Class FileArrayIterator<T>
- java.lang.Object
-
- dk.netarkivet.common.utils.FilterIterator<File,T>
-
- dk.netarkivet.common.utils.FileArrayIterator<T>
-
- Type Parameters:
T
- The type returned by the FileArrayIterator
- All Implemented Interfaces:
Iterator<T>
public abstract class FileArrayIterator<T> extends FilterIterator<File,T>
An iterator that iterates over elements that can be read from files, given an array of files. It is robust against disappearing files, but does not try to find new ones that appear while iterating. It keeps the Iterator contract that next() returns an element if hasNext() returned true since last next(). This may mean that the underlying file has disappeared by the time next() is called, but the object is returned anyway.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
FileArrayIterator(File[] files)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected T
filter(File f)
Returns the T object corresponding to the given file, or null if that object is to be skipped.protected abstract T
getNext(File file)
Gives an object created from the given file, or null.-
Methods inherited from class dk.netarkivet.common.utils.FilterIterator
hasNext, next, remove
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Constructor Detail
-
FileArrayIterator
protected FileArrayIterator(File[] files)
-
-