Package org.apache.jena.util.iterator
Class RandomOrderIterator<T>
- java.lang.Object
-
- org.apache.jena.util.iterator.NiceIterator<T>
-
- org.apache.jena.util.iterator.WrappedIterator<T>
-
- org.apache.jena.util.iterator.RandomOrderIterator<T>
-
- All Implemented Interfaces:
java.util.Iterator<T>
,ClosableIterator<T>
,ExtendedIterator<T>
public class RandomOrderIterator<T> extends WrappedIterator<T>
RandomOrderIterator - Reorders the elements returned by an Iterator.
-
-
Constructor Summary
Constructors Constructor Description RandomOrderIterator(int sz, java.util.Iterator<T> base)
Wrap the base iterator, randomizing with a buffer of length sz.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
hasNext: defer to the base iteratorT
next()
next: defer to the base iteratorvoid
remove()
if .remove() is allowed, delegate to the base iterator's .remove; otherwise, throw an UnsupportedOperationException.-
Methods inherited from class org.apache.jena.util.iterator.WrappedIterator
close, close, create, createIteratorIterator, createNoRemove, forTestingOnly_getBase
-
Methods inherited from class org.apache.jena.util.iterator.NiceIterator
andThen, andThen, asList, asSet, emptyIterator, filterDrop, filterKeep, mapWith, removeNext, toList, toSet
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.jena.util.iterator.ExtendedIterator
forEach, nextOptional
-
-
-
-
Constructor Detail
-
RandomOrderIterator
public RandomOrderIterator(int sz, java.util.Iterator<T> base)
Wrap the base iterator, randomizing with a buffer of length sz.
-
-
Method Detail
-
hasNext
public boolean hasNext()
Description copied from class:WrappedIterator
hasNext: defer to the base iterator- Specified by:
hasNext
in interfacejava.util.Iterator<T>
- Overrides:
hasNext
in classWrappedIterator<T>
-
next
public T next()
Description copied from class:WrappedIterator
next: defer to the base iterator- Specified by:
next
in interfacejava.util.Iterator<T>
- Overrides:
next
in classWrappedIterator<T>
-
remove
public void remove()
Description copied from class:WrappedIterator
if .remove() is allowed, delegate to the base iterator's .remove; otherwise, throw an UnsupportedOperationException.- Specified by:
remove
in interfacejava.util.Iterator<T>
- Overrides:
remove
in classWrappedIterator<T>
-
-