org.apache.jackrabbit.commons.flat
Class FilterIterator<T>
java.lang.Object
org.apache.jackrabbit.commons.flat.FilterIterator<T>
- Type Parameters:
T
-
- All Implemented Interfaces:
- Iterator<T>
public class FilterIterator<T>
- extends Object
- implements Iterator<T>
Iterator filtering out items which do not match a given predicate.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FilterIterator
public FilterIterator(Iterator<T> iterator,
Predicate predicate)
- Create a new filtered iterator based on the given
iterator
.
- Parameters:
iterator
- iterator to filterpredicate
- only item matching this predicate are included
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interface Iterator<T>
next
public T next()
- Specified by:
next
in interface Iterator<T>
remove
public void remove()
- Specified by:
remove
in interface Iterator<T>
- Throws:
UnsupportedOperationException
- always- See Also:
Iterator.remove()
Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.