|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectSimpleGridCoordinates
public class SimpleGridCoordinates
A GridCoordinates implementation which store value in a int[] array.
This class holds the set of grid coordinates that specifies the location of the
grid point within the grid.
| Field Summary | |
|---|---|
protected int[] |
coordinates
The grid coordinates. |
| Constructor Summary | |
|---|---|
SimpleGridCoordinates(int dimension)
Creates a grid coordinates of the specified dimension. |
|
SimpleGridCoordinates(int[] coordinates)
Creates a grid coordinates initialized to the specified values. |
|
SimpleGridCoordinates(int[] coordinates,
int lower,
int upper)
Creates a grid coordinates initialized to the specified values in the specified range. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object object)
Compares this grid coordinates with the specified object for equality. |
int |
getCoordinateValue(int dimension)
Returns the coordinate value at the specified dimension. |
int[] |
getCoordinateValues()
Returns one integer value for each dimension of the grid. |
int |
getDimension()
Returns the number of dimensions. |
int |
hashCode()
Returns a hash code value for this object. |
void |
setCoordinateValue(int dimension,
int value)
Sets the coordinate value at the specified dimension (optional operation). |
String |
toString()
Returns a string representation of this grid coordinates. |
| Methods inherited from class Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final int[] coordinates
| Constructor Detail |
|---|
public SimpleGridCoordinates(int dimension)
dimension - The number of dimension.public SimpleGridCoordinates(int[] coordinates)
coordinates - The grid coordinates to copy.
public SimpleGridCoordinates(int[] coordinates,
int lower,
int upper)
coordinates - The coordinates to copy.lower - Index of the first value to copy, inclusive.upper - Index of the last value to copy, exclusive.| Method Detail |
|---|
public int getDimension()
getCoordinateValues().length. It is
provided for efficiency.
getDimension in interface GridCoordinatespublic int[] getCoordinateValues()
Grid.getAxisNames(). The value of
a single coordinate shall be the number of offsets from the origin of the grid in the
direction of a specific axis.
getCoordinateValues in interface GridCoordinatesSimpleGridCoordinates object.
public int getCoordinateValue(int dimension)
throws ArrayIndexOutOfBoundsException
getCoordinateValues()[i]. It is provided for
efficiency.
getCoordinateValue in interface GridCoordinatesdimension - The dimension from 0 inclusive to getDimension() exclusive.
ArrayIndexOutOfBoundsException - if the specified dimension is out of bounds.
public void setCoordinateValue(int dimension,
int value)
throws ArrayIndexOutOfBoundsException
setCoordinateValue in interface GridCoordinatesdimension - The index of the value to set.value - The new value.
ArrayIndexOutOfBoundsException - if the specified dimension is out of bounds.public boolean equals(Object object)
equals in class Objectobject - The object to compares with this grid coordinates.
true if the given object is equal to this grid coordinates.public int hashCode()
hashCode in class Objectpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||