org.embl.ebi.escience.baclava.iterator
Class BaclavaIterator

java.lang.Object
  extended by org.embl.ebi.escience.baclava.iterator.BaclavaIterator
All Implemented Interfaces:
java.util.Iterator, ResumableIterator

public class BaclavaIterator
extends java.lang.Object
implements ResumableIterator

This provides an Iterator interface with a single additional method to allow reset of the iterator to its starting state. This is required to produce orthogonal joins between iterators used in the implicit iteration mechanism within the enactor.

Author:
Tom Oinn

Constructor Summary
BaclavaIterator(java.util.Collection c)
           
BaclavaIterator(java.util.Collection c, java.util.List indexList)
           
BaclavaIterator(DataThing parent, java.util.Collection c, java.util.List indexList)
          Construct an iterator from a list of non data thing objects, a reference to the parent DataThing which contains them and an explicit index list.
 
Method Summary
 int[] getCurrentLocation()
           
 boolean hasNext()
           
 java.lang.Object next()
           
 void remove()
           
 void reset()
           
 int size()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaclavaIterator

public BaclavaIterator(java.util.Collection c)

BaclavaIterator

public BaclavaIterator(java.util.Collection c,
                       java.util.List indexList)

BaclavaIterator

public BaclavaIterator(DataThing parent,
                       java.util.Collection c,
                       java.util.List indexList)
Construct an iterator from a list of non data thing objects, a reference to the parent DataThing which contains them and an explicit index list. This avoids the overhead of creating all the datathing objects at iterator construction time, something that was causing some serious performance issues, mostly because of the metadata copy operations

Method Detail

getCurrentLocation

public int[] getCurrentLocation()
Specified by:
getCurrentLocation in interface ResumableIterator

hasNext

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

next

public java.lang.Object next()
                      throws java.util.NoSuchElementException
Specified by:
next in interface java.util.Iterator
Throws:
java.util.NoSuchElementException

remove

public void remove()
            throws java.lang.UnsupportedOperationException
Specified by:
remove in interface java.util.Iterator
Throws:
java.lang.UnsupportedOperationException

reset

public void reset()
Specified by:
reset in interface ResumableIterator

size

public int size()
Specified by:
size in interface ResumableIterator