|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object tribble.repository.AbstractDocumentIterator<DocType>
public class AbstractDocumentIterator<DocType extends AbstractDocument>
Abstract generic document set iterator.
A repository document set iterator is an iterator over a collection of repository documents. Such a set is typically the result of a query performed on a repository.
Note: This requires Java 1.5 or later.
AbstractDocument
Field Summary | |
---|---|
protected java.util.ArrayList<DocType> |
m_docs
Document set. |
protected int |
m_modCount
Modification serial number. |
protected int |
m_pos
Current document index within the set. |
Constructor Summary | |
---|---|
protected |
AbstractDocumentIterator(java.util.ArrayList<DocType> docs)
Constructor. |
Method Summary | |
---|---|
void |
close()
Close this document set iterator. |
boolean |
hasNext()
Determine if there are any more documents within the document set. |
DocType |
next()
Retrieve the next document within the document set. |
void |
remove()
Remove the current document from the document set. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.ArrayList<DocType extends AbstractDocument> m_docs
protected int m_pos
protected int m_modCount
Constructor Detail |
---|
protected AbstractDocumentIterator(java.util.ArrayList<DocType> docs)
docs
- Parent list of documents for which this iterator was created.Method Detail |
---|
public void close()
Note that this method does not throw any exceptions.
Note that this method to be called more than once.
close
in interface java.io.Closeable
close
in interface DocumentIterator<DocType extends AbstractDocument>
public boolean hasNext()
hasNext
in interface java.util.Iterator<DocType extends AbstractDocument>
hasNext
in interface DocumentIterator<DocType extends AbstractDocument>
java.io.IOException
- Thrown if an error occurred while accessing the document
iterator.public DocType next()
Note that this method also removes the previous document from the document
set, so calling remove()
is not necessary.
Note also that removed documents do not have their
close()
methods called, which could leave
them in an unstable state. Callers of this method should therefore call
the close() method for each document returned.
next
in interface java.util.Iterator<DocType extends AbstractDocument>
next
in interface DocumentIterator<DocType extends AbstractDocument>
public void remove() throws java.lang.UnsupportedOperationException, java.lang.IllegalStateException
Note that calling this method is not necessary, since next()
automatically removes each document it previously returned.
Note also that removed documents do not have their
close()
methods called, which could leave
them in an unstable state.
remove
in interface java.util.Iterator<DocType extends AbstractDocument>
remove
in interface DocumentIterator<DocType extends AbstractDocument>
java.lang.UnsupportedOperationException
- (unchecked)
Thrown if this operation is not supported by this iterator.
java.lang.IllegalStateException
- (unchecked)
Thrown if next()
has not been called, or if remove()
has
already been called on the same item in the set.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |