com.hp.hpl.jena.util.iterator
Class RandomOrderIterator<T>

java.lang.Object
  extended by com.hp.hpl.jena.util.iterator.NiceIterator<T>
      extended by com.hp.hpl.jena.util.iterator.WrappedIterator<T>
          extended by com.hp.hpl.jena.util.iterator.RandomOrderIterator<T>
All Implemented Interfaces:
ClosableIterator<T>, ExtendedIterator<T>, java.util.Iterator<T>

public class RandomOrderIterator<T>
extends WrappedIterator<T>

RandomOrderIterator - Reorders the elements returned by an Iterator.

Author:
jjc

Constructor Summary
RandomOrderIterator(int sz, java.util.Iterator<T> base)
          Wrap the base iterator, randomizing with a buffer of length sz.
 
Method Summary
 boolean hasNext()
          hasNext: defer to the base iterator
 T next()
          next: defer to the base iterator
 void remove()
          if .remove() is allowed, delegate to the base iterator's .remove; otherwise, throw an UnsupportedOperationException.
 
Methods inherited from class com.hp.hpl.jena.util.iterator.WrappedIterator
close, close, create, createNoRemove, forTestingOnly_getBase
 
Methods inherited from class com.hp.hpl.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
 

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 interface java.util.Iterator<T>
Overrides:
hasNext in class WrappedIterator<T>

next

public T next()
Description copied from class: WrappedIterator
next: defer to the base iterator

Specified by:
next in interface java.util.Iterator<T>
Overrides:
next in class WrappedIterator<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 interface java.util.Iterator<T>
Overrides:
remove in class WrappedIterator<T>


Copyright ? 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP