|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.unh.sdb.common.Bounds
edu.unh.sdb.datasource.ISBounds
edu.unh.sdb.datasource.ISBoundsIterator
public class ISBoundsIterator
The ISBoundsIterator class traverses the specified IndexSpace with the specified shape and the specified steps. use the while loop or for loop to traverse:
ISBoundsIterator iter = new ISBoundsIterator(dsBounds, shape, steps);
while (iter.valid()) { System.out.println(iter.toString()); iter.next(); }
or
for(iter.init(); iter.valid(); iter.next()) {
System.out.println(iter.toString()); }
Field Summary | |
---|---|
protected int[] |
anchor
|
protected boolean[] |
fullShape
|
protected int[] |
lbounds
|
protected AxisOrdering |
ordering
|
protected int[] |
shape
|
protected int[] |
steps
|
protected int[] |
ubounds
|
protected boolean |
valid
|
Fields inherited from class edu.unh.sdb.datasource.ISBounds |
---|
lower, upper |
Constructor Summary | |
---|---|
protected |
ISBoundsIterator(int d)
|
|
ISBoundsIterator(ISBounds space,
int[] shape)
Construct a bounds iterator with no gaps and default AxisOrdering. |
|
ISBoundsIterator(ISBounds space,
int[] shape,
AxisOrdering ordering)
Construct a bounds iterator with no gaps. |
|
ISBoundsIterator(ISBounds space,
int[] shape,
int[] gaps)
Construct a bounds iterator with default AxisOrdering. |
|
ISBoundsIterator(ISBounds space,
int[] shape,
int[] gaps,
AxisOrdering ordering)
Construct an ISBoundsIterator that will traverse the given space with an an ISBounds of the given shape (dimensions). |
|
ISBoundsIterator(ISBounds space,
IntegerIndexSpaceID anchor,
int[] shape)
Construct a bounds iterator with specified anchor position, no gaps and default axis axisOrdering. |
|
ISBoundsIterator(ISBounds space,
IntegerIndexSpaceID anchor,
int[] shape,
AxisOrdering ordering)
Construct a bounds iterator with specified anchor position and no gaps. |
|
ISBoundsIterator(ISBounds space,
IntegerIndexSpaceID anchor,
int[] shape,
int[] gaps)
Construct a bounds iterator with specified anchor position and default axis axisOrdering. |
|
ISBoundsIterator(ISBounds space,
IntegerIndexSpaceID anchor,
int[] shape,
int[] gaps,
AxisOrdering ordering)
Construct an ISBoundsIterator that will traverse the given space with an an ISBounds of the given shape (dimensions). |
|
ISBoundsIterator(ISBounds space,
ISBounds shape)
Construct a bounds iterator with no gaps and default AxisOrdering. |
|
ISBoundsIterator(ISBounds space,
ISBounds shape,
AxisOrdering ordering)
Construct a bounds iterator with no gaps. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Return a copy of this ISBoundsIterator |
ISBounds |
copyBounds()
Return a simple ISBounds corresponding to the current value of this iterator. |
void |
end()
Set the iterator value to the last valid value in the iteration. |
int |
getAxisLength(int axis)
Return the length of this iterator's space along the specified axis. |
AxisOrdering |
getAxisOrdering()
Return the AxisOrdering object for this iterator. |
IndexSpaceID |
getBlockShape()
Return an IndexSpaceID representing the shape of the iterator's blocks. |
AxisOrdering |
getOrdering()
Deprecated. |
ISBounds |
getSpaceBounds()
Returns an ISBounds representing the space being iterated over. |
ISBounds |
getSpaceDimensions()
Returns an ISBounds representing the shape, but not the position, of the space being iterated over. |
int[] |
getSpaceDimensionsArray()
Returns an array of ints representing the dimensions of the space being iterated over. |
IndexSpaceID |
getSteps()
Return an IndexSpaceID representing the iterator's steps. |
protected boolean |
incrementAxis(int axisNumber)
this is a help fuction for next() function, which is to set a specified value to the specified axis if the value is in bounds |
void |
init()
Initialize this ISBoundsIterator |
protected void |
init(ISBounds bounds)
this is a help function for constructor, which is to set the Geometric bounds and initial positon of the shape to traverse. |
protected void |
init(ISBounds bounds,
IntegerIndexSpaceID anchor)
|
boolean |
isFullShape()
Return true if the current position defines a bounds that is the full extent of the shape specifed for the Iterator. |
static void |
main(java.lang.String[] args)
For debugging. |
boolean |
next()
Moving the ISBoundsIterator to the next position. |
protected void |
resetAxis(int axisNumber)
|
void |
setBounds(ISBounds spaceBounds)
Change the bounds of the space that this object iterates over. |
protected void |
setupAndCheck(int[] shape,
int[] gaps)
|
java.lang.String |
toString()
Return a String representing the object. |
java.lang.String |
toString(java.lang.String indent)
Return description of this ISBoundsIterator |
boolean |
valid()
Return true if the current position is a valid position in the IndexSpace. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected AxisOrdering ordering
protected boolean valid
protected boolean[] fullShape
protected int[] shape
protected int[] steps
protected int[] anchor
protected int[] ubounds
protected int[] lbounds
Constructor Detail |
---|
public ISBoundsIterator(ISBounds space, int[] shape, int[] gaps, AxisOrdering ordering)
space
- - space over which iteration is doneshape
- - shape of iteration blockgaps
- - gaps between blocks (can be negative for overlapping iteration)axisOrdering
- - AxisOrdering for the spacepublic ISBoundsIterator(ISBounds space, int[] shape, int[] gaps)
space
- - space over which iteration is doneshape
- - shape of iteration blockgaps
- - gaps between blocks (can be negative for overlapping iteration)public ISBoundsIterator(ISBounds space, int[] shape)
space
- - space over which iteration is doneshape
- - shape of iteration blockpublic ISBoundsIterator(ISBounds space, ISBounds shape)
space
- - space over which iteration is doneshape
- - shape of iteration blockpublic ISBoundsIterator(ISBounds space, int[] shape, AxisOrdering ordering)
space
- - space over which iteration is doneshape
- - shape of iteration blockaxisOrdering
- - AxisOrdering for the spacepublic ISBoundsIterator(ISBounds space, ISBounds shape, AxisOrdering ordering)
space
- - space over which iteration is doneshape
- - shape of iteration blockaxisOrdering
- - AxisOrdering for the spacepublic ISBoundsIterator(ISBounds space, IntegerIndexSpaceID anchor, int[] shape, int[] gaps, AxisOrdering ordering)
space
- - space over which iteration is doneanchor
- - anchor position of partitioningshape
- - shape of iteration blockgaps
- - gaps between blocks (can be negative for overlapping iteration)axisOrdering
- - AxisOrdering for the spacepublic ISBoundsIterator(ISBounds space, IntegerIndexSpaceID anchor, int[] shape)
space
- - space over which iteration is doneanchor
- - anchor position of partitioningshape
- - shape of iteration blockpublic ISBoundsIterator(ISBounds space, IntegerIndexSpaceID anchor, int[] shape, AxisOrdering ordering)
space
- - space over which iteration is doneanchor
- - anchor position of partitioningshape
- - shape of iteration blockaxisOrdering
- - AxisOrdering for the spacepublic ISBoundsIterator(ISBounds space, IntegerIndexSpaceID anchor, int[] shape, int[] gaps)
space
- - space over which iteration is doneanchor
- - anchor position of partitioningshape
- - shape of iteration blockgaps
- - gaps between blocks (can be negative for overlapping iteration)protected ISBoundsIterator(int d)
Method Detail |
---|
protected final void setupAndCheck(int[] shape, int[] gaps)
protected void init(ISBounds bounds)
protected void init(ISBounds bounds, IntegerIndexSpaceID anchor)
public void setBounds(ISBounds spaceBounds)
public void init()
init
in interface SDBIterator
public void end()
end
in interface SDBIterator
public final AxisOrdering getAxisOrdering()
public final AxisOrdering getOrdering()
public final int getAxisLength(int axis)
public final ISBounds getSpaceBounds()
public final ISBounds getSpaceDimensions()
public final int[] getSpaceDimensionsArray()
public final IndexSpaceID getBlockShape()
public final IndexSpaceID getSteps()
protected void resetAxis(int axisNumber)
protected boolean incrementAxis(int axisNumber)
public boolean valid()
valid
in interface SDBIterator
public boolean isFullShape()
public boolean next()
next
in interface SDBIterator
public ISBounds copyBounds()
public java.lang.Object clone()
clone
in class ISBounds
public java.lang.String toString()
toString
in class ISBounds
public java.lang.String toString(java.lang.String indent)
toString
in class ISBounds
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |