com.hp.hpl.jena.util.iterator
Class RandomOrderIterator

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

public class RandomOrderIterator
extends WrappedIterator

RandomOrderIterator - Reorders the elements returned by an Iterator.

Author:
jjc

Constructor Summary
RandomOrderIterator(int sz, java.util.Iterator base)
          Wrap the base iterator, randomizing with a buffer of length sz.
 
Method Summary
 boolean hasNext()
          hasNext: defer to the base iterator
 java.lang.Object 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, emptyIterator, filterDrop, filterKeep, mapWith, removeNext
 
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 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
Overrides:
hasNext in class WrappedIterator

next

public java.lang.Object next()
Description copied from class: WrappedIterator
next: defer to the base iterator

Specified by:
next in interface java.util.Iterator
Overrides:
next in class WrappedIterator

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
Overrides:
remove in class WrappedIterator


Copyright © 2000, 2001, 2002, 2003, 2004, 2005 Hewlett-Packard Development Company, LP