BEA Systems, Inc.

com.beasys.commerce.axiom.document.ref
Class DefaultDocumentIterator

java.lang.Object
  |
  +--com.beasys.commerce.axiom.document.ref.DefaultDocumentIterator

public class DefaultDocumentIterator
extends java.lang.Object
implements DocumentIterator

A wrapper around a iterator or collection which supports a close.


Field Summary
protected  java.util.Collection collection
          The wrapped collection.
protected  java.util.Iterator iterator
          The wrapped iterator.
 
Constructor Summary
DefaultDocumentIterator(java.util.Collection collection)
          Constructor from an collection.
DefaultDocumentIterator(java.util.Collection collection, java.util.Iterator iterator)
          Constructor from a collection and iterator.
DefaultDocumentIterator(java.util.Iterator iterator)
          Constructor from an iterator.
 
Method Summary
 void close()
          Close this iterator.
 boolean hasNext()
          Tell if there is another item in the iteration.
 java.lang.Object next()
          Get the next item in the iteration.
 void remove()
          Remove the last returned object from the iterator's collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

collection

protected java.util.Collection collection
The wrapped collection.

This will be cleared upon a close().


iterator

protected java.util.Iterator iterator
The wrapped iterator.
Constructor Detail

DefaultDocumentIterator

public DefaultDocumentIterator(java.util.Collection collection,
                               java.util.Iterator iterator)
Constructor from a collection and iterator.
Parameters:
collection - the underlying collection.
iterator - the collection's iterator.

DefaultDocumentIterator

public DefaultDocumentIterator(java.util.Collection collection)
Constructor from an collection.
Parameters:
collection - the underlying collection.

DefaultDocumentIterator

public DefaultDocumentIterator(java.util.Iterator iterator)
Constructor from an iterator.
Parameters:
iterator - the iterator to use.
Method Detail

hasNext

public boolean hasNext()
Tell if there is another item in the iteration.

next

public java.lang.Object next()
Get the next item in the iteration.

remove

public void remove()
Remove the last returned object from the iterator's collection.

close

public void close()
Close this iterator.
Specified by:
close in interface DocumentIterator
Tags copied from interface: DocumentIterator
Throws:
DocumentException - thrown on an error.

BEA Systems, Inc.

Copyright © 2000 BEA Systems, Inc. All Rights Reserved