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

java.lang.Object
  extended bycom.hp.hpl.jena.util.iterator.NiceIterator
      extended bycom.hp.hpl.jena.util.iterator.WrappedIterator
All Implemented Interfaces:
ClosableIterator, ExtendedIterator, java.util.Iterator
Direct Known Subclasses:
EarlyBindingIterator, FilterIterator, Map1Iterator, 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(java.util.Iterator it)
          if _it_ is a Closableiterator, close it.
static WrappedIterator create(java.util.Iterator it)
          factory method for creating a wrapper around _it_.
 boolean hasNext()
          hasNext: defer to the base iterator
 java.lang.Object next()
          next: defer to the base iterator
 void remove()
          remove: defer to the base iterator
 
Methods inherited from class com.hp.hpl.jena.util.iterator.NiceIterator
andThen, andThen, filterDrop, filterKeep, mapWith
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static WrappedIterator create(java.util.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.


hasNext

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

Specified by:
hasNext in interface java.util.Iterator
Overrides:
hasNext in class NiceIterator

next

public java.lang.Object next()
next: defer to the base iterator

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

remove

public void remove()
remove: defer to the base iterator

Specified by:
remove in interface java.util.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(java.util.Iterator it)
if _it_ is a Closableiterator, close it. Abstracts away from tests [that were] scattered through the code.



Copyright © 2001-2003 Hewlett-Packard. All Rights Reserved.