edu.unh.sdb.datasource
Class RandomBlockIterator

java.lang.Object
  extended by edu.unh.sdb.datasource.RandomBlockIterator

public class RandomBlockIterator
extends java.lang.Object

this class generates a BlockIterator that randomly moves within this ISBounds of the iteration data source. Iteration block does not partially overlap with the datablock of previous iteration steps. If setEnumWindow( int size) is called, enumeration window will be used during the iteration process. That means ISbounds of future iteration steps will be generated. The iteration space is partitioned based on the size of iteration block.


Constructor Summary
RandomBlockIterator(ISBounds partitionSpaceBounds, ISBounds iterationBounds, Indexable iterationSource)
          The partSpaceBounds is the iterationBounds in the partitioned space
 
Method Summary
 ISBounds[] getEnumWindow()
           
 int getEnumWindowIndex()
           
 ISBounds getIteratorBounds()
          get the bounds of this block iterator
 ISBounds getWindowElement(int windowIndex)
          return the ISBounds of an indexed enumeration window element
 void init()
          initialize the iterator, read data values from the source into the iteration block.
 boolean isWindowOpen()
          return if the enumeration window is open or closed
static void main(java.lang.String[] args)
           
 void next()
          move to next iteration step
 ISBounds nextBounds()
          get ISBounds of next iteration step
 void renewEnumWindow()
          preproces the iteration
 void setSource(DataSource iterationSource)
          Set the iteration data source
 void setWindowSize(int size)
          set the enumberation window size
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RandomBlockIterator

public RandomBlockIterator(ISBounds partitionSpaceBounds,
                           ISBounds iterationBounds,
                           Indexable iterationSource)
The partSpaceBounds is the iterationBounds in the partitioned space

Method Detail

getIteratorBounds

public ISBounds getIteratorBounds()
get the bounds of this block iterator


init

public void init()
initialize the iterator, read data values from the source into the iteration block. Currently I use BasicBlock as the container BasicBlock uses the default axisOrdering


setSource

public void setSource(DataSource iterationSource)
Set the iteration data source


setWindowSize

public void setWindowSize(int size)
set the enumberation window size


next

public void next()
move to next iteration step


isWindowOpen

public boolean isWindowOpen()
return if the enumeration window is open or closed


renewEnumWindow

public void renewEnumWindow()
preproces the iteration


getEnumWindow

public ISBounds[] getEnumWindow()

getWindowElement

public ISBounds getWindowElement(int windowIndex)
return the ISBounds of an indexed enumeration window element


getEnumWindowIndex

public int getEnumWindowIndex()

nextBounds

public ISBounds nextBounds()
get ISBounds of next iteration step


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

main

public static void main(java.lang.String[] args)