edu.unh.sdb.datasource
Class ISIterator

java.lang.Object
  extended by edu.unh.sdb.common.SpaceID
      extended by edu.unh.sdb.datasource.IndexSpaceID
          extended by edu.unh.sdb.datasource.ISIterator
All Implemented Interfaces:
SDBIterator, java.lang.Cloneable
Direct Known Subclasses:
DCIterator

public class ISIterator
extends IndexSpaceID
implements java.lang.Cloneable, SDBIterator

Child class of IndexSpaceID. ISIterator can iterate through an IndexSpace


Constructor Summary
ISIterator(ISBounds db)
          Constructor taking an ISBounds, which specifies the IndexSpace
ISIterator(ISBounds db, AxisOrdering ord)
          Constructor taking an ISBounds, which specifies the IndexSpace, and the AxisOrdering which specifies the axis incrementation order
ISIterator(ISBounds db, AxisOrdering ord, int[] steps)
          Constructor taking an ISBounds, AxisOrdering and steps array
ISIterator(ISBounds db, int[] steps)
          Constructor taking an ISBounds, which specifies the IndexSpace and the steps array allowing ISIterator increment step other than 1
 
Method Summary
 java.lang.Object clone()
          Return a copy of this ISIterator
 boolean containedBy(ISBounds db)
          Returns true if this IndexSpaceID is contained by the ISBounds parameter, or false otherwise.
 IndexSpaceID copy()
          Deprecated.  
 IndexSpaceID copyID()
          Return an IntegerIndexSpaceID corresponding to the current position.
 int dim()
          Returns the dimensionality of this ISIterator.
 void end()
          Set the iterator value to the last valid value in the iteration.
 int getAxisLength(int axis)
          Return the number of elements that lie along the specified axis in the iterator's bounds.
 int[] getAxisLengthArray()
          Returns an array of ints representing the dimensions of the space being iterated over.
 IndexSpaceID getAxisLengths()
          Returns an IndexSpaceID representing the dimensions of the space being iterated over.
 AxisOrdering getAxisOrdering()
          Return the AxisOrdering for this iterator.
 ISBounds getBounds()
          Return the ISBounds over which this ISIterator is iterating.
 int getCoord(int axisNumber)
          Get the value corresponding to the specified axis.
 int[] getCoords(int[] coords)
          Fill the array argument with the coordinate values for this ISID.
 AxisOrdering getOrdering()
          Deprecated.  
 ISBounds getSpaceBounds()
          Deprecated. Use getBounds()
 boolean hasMoreElements()
          Return true if this ISIterator can be incremented.
 void init()
          Initilize this ISiterator
static void main(java.lang.String[] args)
           
 void moveTo(IndexSpaceID newOrigin)
          Reposition the bounds of this iterator so that its lower bound is at the position specified by the argument.
 void moveTo(int[] newOrigin)
          Reposition the bounds of this iterator so that its lower bound is at the position specified by the argument.
 boolean next()
          Increment the ISIterator to the next position.
 int[] refLowerArray()
          Return a reference to the lower bounds of the iteration space.
 int[] refUpperArray()
          Return a reference to the lower bounds of the iteration space.
 IndexSpaceID relativeLocation()
          Map the current position of this iterator to an equivalent IndexSpaceID relative to the lower bound of this iterator
 IndexSpaceID relativeLocation(IndexSpaceID isid)
          Map the current position of this iterator to an equivalent IndexSpaceID relative to the lower bound of this iterator.
 void setBounds(ISBounds bound)
          Change the IndexSpace to which this ISIterator is bound
 void setCoord(int axisNumber, int value)
          Set the specified axis to the specified value.
 void setSpaceBounds(ISBounds bound)
          Deprecated. Use setBounds( ISBounds )
 void setSteps(int[] newSteps)
          Define a new steps array for the iterator
 java.lang.String toString()
          Return description of this ISIterator
 boolean valid()
          Return true if the current position is a valid position in the IndexSpace.
 
Methods inherited from class edu.unh.sdb.datasource.IndexSpaceID
add, add, divide, equals, getCoords, greaterThanOrEqual, lessThanOrEqual, mod, multiply, negate, project, scale, scale, setDimensionsInUnits, shift, subtract, subtract, subtract, toString, volume
 
Methods inherited from class edu.unh.sdb.common.SpaceID
setCoord
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ISIterator

public ISIterator(ISBounds db)
Constructor taking an ISBounds, which specifies the IndexSpace


ISIterator

public ISIterator(ISBounds db,
                  AxisOrdering ord)
Constructor taking an ISBounds, which specifies the IndexSpace, and the AxisOrdering which specifies the axis incrementation order


ISIterator

public ISIterator(ISBounds db,
                  int[] steps)
Constructor taking an ISBounds, which specifies the IndexSpace and the steps array allowing ISIterator increment step other than 1


ISIterator

public ISIterator(ISBounds db,
                  AxisOrdering ord,
                  int[] steps)
Constructor taking an ISBounds, AxisOrdering and steps array

Method Detail

copyID

public IndexSpaceID copyID()
Return an IntegerIndexSpaceID corresponding to the current position.

Specified by:
copyID in class IndexSpaceID

clone

public java.lang.Object clone()
Return a copy of this ISIterator

Specified by:
clone in class SpaceID

copy

public IndexSpaceID copy()
Deprecated. 

Return a copy of this ISIterator. Has been replaced by clone() method.


toString

public java.lang.String toString()
Return description of this ISIterator

Overrides:
toString in class IndexSpaceID

getAxisOrdering

public final AxisOrdering getAxisOrdering()
Return the AxisOrdering for this iterator.


getOrdering

public final AxisOrdering getOrdering()
Deprecated. 

Return the AxisOrdering for this iterator.


getAxisLength

public final int getAxisLength(int axis)
Return the number of elements that lie along the specified axis in the iterator's bounds.


getAxisLengthArray

public final int[] getAxisLengthArray()
Returns an array of ints representing the dimensions of the space being iterated over.


getAxisLengths

public final IndexSpaceID getAxisLengths()
Returns an IndexSpaceID representing the dimensions of the space being iterated over.


relativeLocation

public IndexSpaceID relativeLocation()
Map the current position of this iterator to an equivalent IndexSpaceID relative to the lower bound of this iterator


relativeLocation

public IndexSpaceID relativeLocation(IndexSpaceID isid)
Map the current position of this iterator to an equivalent IndexSpaceID relative to the lower bound of this iterator. If the argument is not null, update the argument's position. If the argument is null, create a new IndexSpaceID.


moveTo

public void moveTo(IndexSpaceID newOrigin)
Reposition the bounds of this iterator so that its lower bound is at the position specified by the argument. Although it only makes sense to do this prior to an iteration, the current position of the iterator is also updated based on the relative change of the lower bound.


moveTo

public void moveTo(int[] newOrigin)
Reposition the bounds of this iterator so that its lower bound is at the position specified by the argument. Although it only makes sense to do this prior to an iteration, the current position of the iterator is also updated based on the relative change of the lower bound.


setBounds

public void setBounds(ISBounds bound)
Change the IndexSpace to which this ISIterator is bound


setSteps

public void setSteps(int[] newSteps)
Define a new steps array for the iterator


setSpaceBounds

public void setSpaceBounds(ISBounds bound)
Deprecated. Use setBounds( ISBounds )

Change the IndexSpace to which this ISIterator is bound


getBounds

public ISBounds getBounds()
Return the ISBounds over which this ISIterator is iterating.


getSpaceBounds

public ISBounds getSpaceBounds()
Deprecated. Use getBounds()

Return the ISBounds over which this ISIterator is iterating.


refLowerArray

public int[] refLowerArray()
Return a reference to the lower bounds of the iteration space.


refUpperArray

public int[] refUpperArray()
Return a reference to the lower bounds of the iteration space.


init

public void init()
Initilize this ISiterator

Specified by:
init in interface SDBIterator

end

public void end()
Set the iterator value to the last valid value in the iteration.

Specified by:
end in interface SDBIterator

getCoord

public int getCoord(int axisNumber)
Get the value corresponding to the specified axis.

Specified by:
getCoord in class IndexSpaceID

getCoords

public int[] getCoords(int[] coords)
Fill the array argument with the coordinate values for this ISID. For convenience, a reference to the argument array is returned.

Specified by:
getCoords in class IndexSpaceID

setCoord

public void setCoord(int axisNumber,
                     int value)
Set the specified axis to the specified value.

Overrides:
setCoord in class SpaceID

dim

public int dim()
Returns the dimensionality of this ISIterator.

Specified by:
dim in class SpaceID

valid

public boolean valid()
Return true if the current position is a valid position in the IndexSpace.

Specified by:
valid in interface SDBIterator

next

public boolean next()
Increment the ISIterator to the next position.

Specified by:
next in interface SDBIterator

hasMoreElements

public boolean hasMoreElements()
Return true if this ISIterator can be incremented.


containedBy

public boolean containedBy(ISBounds db)
Returns true if this IndexSpaceID is contained by the ISBounds parameter, or false otherwise. If the ISBounds has a diifferent dimensionality than this IndexSpaceID, then a DimensionalityException is thrown.

Overrides:
containedBy in class IndexSpaceID

main

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