com.waveset.util
Class BlockIterator

java.lang.Object
  extended bycom.waveset.util.BlockIterator
All Implemented Interfaces:
java.util.Iterator

Deprecated. as of 7.0, for iteration of block-oriented datastreams consider using the Supplier and DoubleBufferedQueue classes instead.

public abstract class BlockIterator
extends java.lang.Object
implements java.util.Iterator

This is a simple abstract class to help convert producers of blocks of data to the standard java Iterator interface.

Features: Notes: The method remove is not supported.

See Also:
Supplier, com.waveset.util.DoubleBufferedQueue

Constructor Summary
BlockIterator()
          Deprecated.  
 
Method Summary
abstract  boolean fill(java.util.Collection l)
          Deprecated. Fill the collection provided.
 boolean hasNext()
          Deprecated.  
 java.lang.Object next()
          Deprecated.  
 void remove()
          Deprecated. Not supported.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlockIterator

public BlockIterator()
Deprecated. 
Method Detail

hasNext

public boolean hasNext()
Deprecated. 
Specified by:
hasNext in interface java.util.Iterator

next

public java.lang.Object next()
Deprecated. 
Specified by:
next in interface java.util.Iterator

remove

public void remove()
Deprecated. 
Not supported.

Specified by:
remove in interface java.util.Iterator

fill

public abstract boolean fill(java.util.Collection l)
Deprecated. 
Fill the collection provided. If there are more blocks of data to retreive return true, if there are no more blocks of data return false. If there is an error to pass to the consumer throw a RuntimeException. The consumer will have the choice of continuing the interation.

Turn on asserts to test if the API is being used correctly. For instance returning true and an empty collection is invalid.

Parameters:
l - Collection to add the individual object of the block of data to.
Returns:
Returns true if there are no more blocks of data else false.