edu.unh.sdb.datasource
Class IntegerIndexSpaceID

java.lang.Object
  extended by edu.unh.sdb.common.SpaceID
      extended by edu.unh.sdb.datasource.IndexSpaceID
          extended by edu.unh.sdb.datasource.IntegerIndexSpaceID
All Implemented Interfaces:
java.lang.Cloneable

public class IntegerIndexSpaceID
extends IndexSpaceID

This class implements the IndexSpaceID class using an array of integers.


Field Summary
protected  int[] axes
           
 
Constructor Summary
IntegerIndexSpaceID(IndexSpaceID id)
          Constructs an IntegerIndexSpaceID from the contents of the IndexSpaceID argument.
IntegerIndexSpaceID(IndexSpaceID id, int value)
          Constructs an IntegerIndexSpaceID with dimensionality matching id and all values set to value
IntegerIndexSpaceID(int i)
          Constructs a one dimensional IntegerIndexSpaceID with axis value set to the argument.
IntegerIndexSpaceID(int[] axes)
          Constructs a IntegerIndexSpaceID with dimensionality matching the length of the parameter array.
IntegerIndexSpaceID(IntegerIndexSpaceID id)
          Constructs an IntegerIndexSpaceID from the contents of the IntegerIndexSpaceID argument.
IntegerIndexSpaceID(int i, int j)
          Constructs a two dimensional IntegerIndexSpaceID with axis values set to the given values.
IntegerIndexSpaceID(int i, int j, int k)
          Constructs a three dimensional IntegerIndexSpaceID with axis values set to the given values.
 
Method Summary
 java.lang.Object clone()
          Return a copy of this IndexSpaceID.
 IndexSpaceID copyID()
          Return a copy of this IndexSpaceID.
 int dim()
          Returns the dimensionality of this IndexSpaceID.
 boolean equals(java.lang.Object obj)
          Return true if parameter is equal to this object, false otherwise.
 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.
static void main(java.lang.String[] args)
           
 void setCoord(int axisNumber, int value)
          Set the specified axis to the specified value.
 java.lang.String toString()
          Return a String representing the object.
 java.lang.String toString(java.lang.String indent)
          Return a String representing the object indented by the argument string.
 
Methods inherited from class edu.unh.sdb.datasource.IndexSpaceID
add, add, containedBy, divide, getCoords, greaterThanOrEqual, lessThanOrEqual, mod, multiply, negate, project, scale, scale, setDimensionsInUnits, shift, subtract, subtract, subtract, 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
 

Field Detail

axes

protected int[] axes
Constructor Detail

IntegerIndexSpaceID

public IntegerIndexSpaceID(int i)
Constructs a one dimensional IntegerIndexSpaceID with axis value set to the argument.


IntegerIndexSpaceID

public IntegerIndexSpaceID(int i,
                           int j)
Constructs a two dimensional IntegerIndexSpaceID with axis values set to the given values.


IntegerIndexSpaceID

public IntegerIndexSpaceID(int i,
                           int j,
                           int k)
Constructs a three dimensional IntegerIndexSpaceID with axis values set to the given values.


IntegerIndexSpaceID

public IntegerIndexSpaceID(int[] axes)
Constructs a IntegerIndexSpaceID with dimensionality matching the length of the parameter array. The axes will be set to the contents of the array.


IntegerIndexSpaceID

public IntegerIndexSpaceID(IndexSpaceID id,
                           int value)
Constructs an IntegerIndexSpaceID with dimensionality matching id and all values set to value


IntegerIndexSpaceID

public IntegerIndexSpaceID(IndexSpaceID id)
Constructs an IntegerIndexSpaceID from the contents of the IndexSpaceID argument.


IntegerIndexSpaceID

public IntegerIndexSpaceID(IntegerIndexSpaceID id)
Constructs an IntegerIndexSpaceID from the contents of the IntegerIndexSpaceID argument.

Method Detail

copyID

public final IndexSpaceID copyID()
Return a copy of this IndexSpaceID.

Specified by:
copyID in class IndexSpaceID

clone

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

Specified by:
clone in class SpaceID

getCoord

public final int getCoord(int axisNumber)
Get the value corresponding to the specified axis. If the specified axis is out of bounds, a DimensionalityError is created.

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. null is valid for the argument and results in a new array being allocated and returned.

Specified by:
getCoords in class IndexSpaceID

setCoord

public void setCoord(int axisNumber,
                     int value)
Set the specified axis to the specified value. If the specified axis is too large, a DimensionalityError is created.

Overrides:
setCoord in class SpaceID

dim

public final int dim()
Returns the dimensionality of this IndexSpaceID.

Specified by:
dim in class SpaceID

equals

public boolean equals(java.lang.Object obj)
Return true if parameter is equal to this object, false otherwise.

Overrides:
equals in class IndexSpaceID

toString

public java.lang.String toString()
Return a String representing the object.

Overrides:
toString in class IndexSpaceID

toString

public java.lang.String toString(java.lang.String indent)
Return a String representing the object indented by the argument string.

Overrides:
toString in class IndexSpaceID

main

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