com.bigdata.striterator
Class ClosableEmptyIterator<E>

java.lang.Object
  extended by com.bigdata.striterator.ClosableEmptyIterator<E>
All Implemented Interfaces:
ICloseableIterator<E>, Iterator<E>

public class ClosableEmptyIterator<E>
extends Object
implements ICloseableIterator<E>

A closable iterator that visits nothing.

Version:
$Id: ClosableEmptyIterator.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson

Constructor Summary
ClosableEmptyIterator()
           
 
Method Summary
 void close()
          Closes the iterator, releasing any associated resources.
 boolean hasNext()
           
 E next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClosableEmptyIterator

public ClosableEmptyIterator()
Method Detail

close

public void close()
Description copied from interface: ICloseableIterator
Closes the iterator, releasing any associated resources. This method MAY be invoked safely if the iterator is already closed. Implementations of this interface MUST invoke ICloseableIterator.close() if Iterator.hasNext() method returns false to ensure that the iterator is closed (and its resources release) as soon as it is exhausted.

Note: Implementations that support Iterator.remove() MUST NOT eagerly close the iterator when it is exhausted since that would make it impossible to remove the last visited statement. Instead they MUST wait for an explicit ICloseableIterator.close() by the application.

Specified by:
close in interface ICloseableIterator<E>

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<E>

next

public E next()
Specified by:
next in interface Iterator<E>

remove

public void remove()
Specified by:
remove in interface Iterator<E>


Copyright © 2006-2012 SYSTAP, LLC. All Rights Reserved.