com.unister.semweb.drums.api
Class DRUMSIterator<Data extends AbstractKVStorable>

java.lang.Object
  extended by com.unister.semweb.drums.api.DRUMSIterator<Data>
Type Parameters:
Data - an implementation of AbstractKVStorable, e.g. GeneralStorable
All Implemented Interfaces:
java.io.Closeable, java.util.Iterator<Data>

public class DRUMSIterator<Data extends AbstractKVStorable>
extends java.lang.Object
implements java.util.Iterator<Data>, java.io.Closeable

An instance of this class provides a Read-Only-Iterator for a given DRUMS-table. During iteration, no elements should be inserted by another process.

Author:
Martin Nettling

Constructor Summary
DRUMSIterator(AbstractHashFunction hashFunction, DRUMSParameterSet<Data> globalparameters)
          Initializes the iterator with the hash function and the global parameters.
 
Method Summary
 void close()
          Closes this iterator.
 boolean hasNext()
          Returns true if this iterator has one more element, otherwise it returns false.
 Data next()
           
 void remove()
          Operation is NOT supported by this iterator.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DRUMSIterator

public DRUMSIterator(AbstractHashFunction hashFunction,
                     DRUMSParameterSet<Data> globalparameters)
Initializes the iterator with the hash function and the global parameters.

Parameters:
hashFunction -
globalparameters -
Method Detail

hasNext

public boolean hasNext()
Returns true if this iterator has one more element, otherwise it returns false. If an error occurs while accessing the bucket file an IllegalStateException is thrown.

Specified by:
hasNext in interface java.util.Iterator<Data extends AbstractKVStorable>

next

public Data next()
Specified by:
next in interface java.util.Iterator<Data extends AbstractKVStorable>

remove

public void remove()
Operation is NOT supported by this iterator.

Specified by:
remove in interface java.util.Iterator<Data extends AbstractKVStorable>

close

public void close()
           throws java.io.IOException
Closes this iterator.

Specified by:
close in interface java.io.Closeable
Throws:
java.io.IOException