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

java.lang.Object
  extended by com.hp.hpl.jena.util.iterator.NiceIterator
      extended by com.hp.hpl.jena.util.iterator.WrappedIterator
All Implemented Interfaces:
ClosableIterator, ExtendedIterator, Iterator
Direct Known Subclasses:
EarlyBindingIterator, FilterIterator, Map1Iterator, RandomOrderIterator, UniqueExtendedIterator

public class WrappedIterator
extends NiceIterator

a WrappedIterator is an ExtendedIterator wrapping around a plain (or presented as plain) Iterator. The wrapping allows the usual extended operations (filtering, concatenating) to be done on an Iterator derived from some other source.

Author:
kers

Method Summary
 void close()
          close: defer to the base, iff it is closable
static void close(Iterator it)
          if _it_ is a Closableiterator, close it.
static ExtendedIterator create(Iterator it)
          factory method for creating a wrapper around _it_.
static WrappedIterator createNoRemove(Iterator it)
           
 boolean hasNext()
          hasNext: defer to the base iterator
 Object next()
          next: defer to the base iterator
 void remove()
          if .remove() is allowed, delegate to the abse iterator's .remove; otherwise, throw an UnsupportedOperationException.
 
Methods inherited from class com.hp.hpl.jena.util.iterator.NiceIterator
andThen, andThen, filterDrop, filterKeep, mapWith, removeNext
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static ExtendedIterator create(Iterator it)
factory method for creating a wrapper around _it_. We reserve the right to deliver the argument if it's already an extended iterator.


createNoRemove

public static WrappedIterator createNoRemove(Iterator it)

hasNext

public boolean hasNext()
hasNext: defer to the base iterator

Specified by:
hasNext in interface Iterator
Overrides:
hasNext in class NiceIterator

next

public Object next()
next: defer to the base iterator

Specified by:
next in interface Iterator
Overrides:
next in class NiceIterator

remove

public void remove()
if .remove() is allowed, delegate to the abse iterator's .remove; otherwise, throw an UnsupportedOperationException.

Specified by:
remove in interface Iterator
Overrides:
remove in class NiceIterator

close

public void close()
close: defer to the base, iff it is closable

Specified by:
close in interface ClosableIterator
Overrides:
close in class NiceIterator

close

public static void close(Iterator it)
if _it_ is a Closableiterator, close it. Abstracts away from tests [that were] scattered through the code.



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