edu.unh.sdb.datasource
Class IndexSpaceID

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

public abstract class IndexSpaceID
extends SpaceID

The IndexSpaceID class represents points in a DataSource index space


Constructor Summary
IndexSpaceID()
           
 
Method Summary
 void add(IndexSpaceID id)
          For each axis of this IndexSpaceID, add the value of the corresponding axis of the parameter.
 void add(int axis, int value)
          For the specified axis of this IndexSpaceID, add specified value.
 boolean containedBy(ISBounds b)
          Returns true if this IndexSpaceID is contained by the ISBounds parameter, or false otherwise.
abstract  IndexSpaceID copyID()
          Makes a copy of an IndexSpaceID object that is guaranteed not to copy iterator information in the case that the object is actually an iterator.
 IndexSpaceID divide(IndexSpaceID other)
          Pairwise divide this IndexSpaceID with 'other' and store the result in this.
 boolean equals(java.lang.Object obj)
          Return true if the argument is an IndexSpaceID representing the same coordinates as this object, false otherwise.
abstract  int getCoord(int axisNumber)
          Get the value corresponding to the specified axis.
 int[] getCoords()
          Return an array with the coordinate values for this ISID.
abstract  int[] getCoords(int[] coords)
          Fill the array argument with the coordinate values for this ISID.
 boolean greaterThanOrEqual(IndexSpaceID id)
          A helper function that returns true if all the coordinates of this id are greater than or equal to the corresponding coordinates of the parameter id.
 boolean lessThanOrEqual(IndexSpaceID id)
          A helper function that returns true if all the coordinates of this id are less than or equal to the corresponding coordinates of the parameter id.
static void main(java.lang.String[] args)
           
 IndexSpaceID mod(IndexSpaceID other)
          Calculate pairwise mod of this IndexSpaceID with 'other' and store the result in 'this'.
 IndexSpaceID multiply(IndexSpaceID other)
          Pairwise multiply this IndexSpaceID with 'other' and store the result in this.
 void negate()
          Arithmetically negate this IndexSpaceID's axis values.
 IndexSpaceID project(int axis)
          Returns a new IndexSpaceID which is the projection of this IndexSpaceID onto a plane orthogonal to the specified axis.
 IndexSpaceID scale(double m)
          Scale this IndexSpaceID's axis values by the given double.
 IndexSpaceID scale(int m)
          Scale this IndexSpaceID's axis values by the given integer.
 IndexSpaceID setDimensionsInUnits(IndexSpaceID unit)
          Sets this to the IndexSpaceID representing the dimensions in units of the hypercube whose dimensions in points are specified by this IndexSpaceID.
 IndexSpaceID shift(IndexSpaceID other)
          Pairwise shift this IndexSpaceID with 'other' and store the result in this.
 IndexSpaceID subtract(IndexSpaceID id)
          For each axis of this IndexSpaceID, subtract the value of the corresponding axis of the parameter.
 void subtract(IndexSpaceID result, IndexSpaceID id)
          For each axis of this IndexSpaceID, subtract the value of the corresponding axis of the second argument, and assign the result to the first argument.
 void subtract(int axis, int value)
          For the specified axis of this IndexSpaceID, subtract 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.
 long volume()
           
 
Methods inherited from class edu.unh.sdb.common.SpaceID
clone, dim, setCoord, setCoord
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IndexSpaceID

public IndexSpaceID()
Method Detail

copyID

public abstract IndexSpaceID copyID()
Makes a copy of an IndexSpaceID object that is guaranteed not to copy iterator information in the case that the object is actually an iterator.


getCoord

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


getCoords

public abstract 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.


getCoords

public int[] getCoords()
Return an array with the coordinate values for this ISID. This copies the values.


add

public void add(IndexSpaceID id)
For each axis of this IndexSpaceID, add the value of the corresponding axis of the parameter. If the dimensionality of the parameter is not at least as large as the dimensionality of this object, then a DimensionalityError is created.


volume

public long volume()

setDimensionsInUnits

public IndexSpaceID setDimensionsInUnits(IndexSpaceID unit)
Sets this to the IndexSpaceID representing the dimensions in units of the hypercube whose dimensions in points are specified by this IndexSpaceID. A reference to 'this' is returned.


add

public void add(int axis,
                int value)
For the specified axis of this IndexSpaceID, add specified value. If the specified axis is not less than the dimensionality of this IndexSpaceID, a dimensionality error is created.


subtract

public void subtract(int axis,
                     int value)
For the specified axis of this IndexSpaceID, subtract specified value. If the specified axis is not less than the dimensionality of this IndexSpaceID, a dimensionality error is created.


negate

public final void negate()
Arithmetically negate this IndexSpaceID's axis values.


subtract

public IndexSpaceID subtract(IndexSpaceID id)
For each axis of this IndexSpaceID, subtract the value of the corresponding axis of the parameter. If the dimensionality of the parameter is not at least as large as the dimensionality of this object, then a DimensionalityError is created.


subtract

public void subtract(IndexSpaceID result,
                     IndexSpaceID id)
For each axis of this IndexSpaceID, subtract the value of the corresponding axis of the second argument, and assign the result to the first argument. If the dimensionality of the parameter is not at least as large as the dimensionality of this object, then a DimensionalityError is created.


scale

public final IndexSpaceID scale(int m)
Scale this IndexSpaceID's axis values by the given integer. A reference to 'this' is returned as a convenience.


multiply

public final IndexSpaceID multiply(IndexSpaceID other)
Pairwise multiply this IndexSpaceID with 'other' and store the result in this. A reference to 'this' is returned.


divide

public final IndexSpaceID divide(IndexSpaceID other)
Pairwise divide this IndexSpaceID with 'other' and store the result in this. A reference to 'this' is returned.


shift

public final IndexSpaceID shift(IndexSpaceID other)
Pairwise shift this IndexSpaceID with 'other' and store the result in this. A reference to 'this' is returned.


mod

public final IndexSpaceID mod(IndexSpaceID other)
Calculate pairwise mod of this IndexSpaceID with 'other' and store the result in 'this'. A reference to 'this' is returned.


scale

public final IndexSpaceID scale(double m)
Scale this IndexSpaceID's axis values by the given double. Axis values are rounded to the nearest integer. A reference to 'this' is returned as a convenience.


project

public IndexSpaceID project(int axis)
Returns a new IndexSpaceID which is the projection of this IndexSpaceID onto a plane orthogonal to the specified axis. The dimensionality of the result will therefore always be one less than the dimensionality of this object, as long as the axis is valid for this IndexSpaceID. If the specified axis is not valid, an error is created.


containedBy

public boolean containedBy(ISBounds b)
Returns true if this IndexSpaceID is contained by the ISBounds parameter, or false otherwise. If the dimensionality of the parameter is not at least as large as the dimensionality of this object, then a DimensionalityError is created.


equals

public boolean equals(java.lang.Object obj)
Return true if the argument is an IndexSpaceID representing the same coordinates as this object, false otherwise.

Overrides:
equals in class java.lang.Object

lessThanOrEqual

public boolean lessThanOrEqual(IndexSpaceID id)
A helper function that returns true if all the coordinates of this id are less than or equal to the corresponding coordinates of the parameter id. If any coordinate is greater than the parameter coordinate, then false is returned. If the dimensionality of the parameter is not at least as large as the dimensionality of this object, then a DimensionalityError is created.


greaterThanOrEqual

public boolean greaterThanOrEqual(IndexSpaceID id)
A helper function that returns true if all the coordinates of this id are greater than or equal to the corresponding coordinates of the parameter id. If any coordinate is less than the parameter coordinate, then false is returned. If the dimensionality of the parameter is not at least as large as the dimensionality of this object, then a DimensionalityError is created.


toString

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

Overrides:
toString in class java.lang.Object

toString

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


main

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