org.apache.jdo.query
Class BasicQueryResult.BasicQueryResultIterator

java.lang.Object
  extended by org.apache.jdo.query.BasicQueryResult.BasicQueryResultIterator
All Implemented Interfaces:
java.util.Iterator, QueryResultIterator
Enclosing class:
BasicQueryResult

public class BasicQueryResult.BasicQueryResultIterator
extends java.lang.Object
implements QueryResultIterator

The internal query result iterator supports all iterator methods plus close, allowing early release of resources.


Method Summary
 void close()
          Close this iterator and release any resources held.
 boolean hasNext()
          Return true if this query result iterator has not been closed and the internal iterator has more elements.
 boolean isClosed()
          Return true if the user has closed this iterator.
 java.lang.Object next()
          Advance and return the next element of the iterator.
 void remove()
          Throw an exception.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

hasNext

public boolean hasNext()
Return true if this query result iterator has not been closed and the internal iterator has more elements.

Specified by:
hasNext in interface java.util.Iterator
Returns:
true if there are more elements.

next

public java.lang.Object next()
Advance and return the next element of the iterator.

Specified by:
next in interface java.util.Iterator
Returns:
the next element of the iterator.

close

public void close()
Close this iterator and release any resources held. After this method completes, the iterator will return false to hasNext(), and will throw NoSuchElementException to next().

Specified by:
close in interface QueryResultIterator

remove

public void remove()
Throw an exception. This iterator is read-only.

Specified by:
remove in interface java.util.Iterator

isClosed

public boolean isClosed()
Return true if the user has closed this iterator.

Returns:
true if the user has closed this iterator.


Copyright © 2005-2008 Apache Software Foundation. All Rights Reserved.