|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectGeneralGridCoordinates
public class GeneralGridCoordinates
Holds the set of grid coordinates that specifies the location of the grid point within the grid.
GridCoordinates2D
,
Serialized FormNested Class Summary | |
---|---|
static class |
GeneralGridCoordinates.Immutable
An immutable GridCoordinates . |
Constructor Summary | |
---|---|
GeneralGridCoordinates(GridCoordinates coordinates)
Creates a grid coordinates which is a copy of the specified one. |
|
GeneralGridCoordinates(int dimension)
Creates a grid coordinates of the specified dimension. |
|
GeneralGridCoordinates(int[] coordinates)
Creates a grid coordinates initialized to the specified values. |
|
GeneralGridCoordinates(int[] coordinates,
int lower,
int upper)
Creates a grid coordinates initialized to the specified values in the specified range. |
Method Summary | |
---|---|
GeneralGridCoordinates |
clone()
Returns a clone of this grid coordinates. |
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 |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GeneralGridCoordinates(int dimension)
dimension
- The number of dimension.public GeneralGridCoordinates(int[] coordinates)
coordinates
- The grid coordinates to copy.public GeneralGridCoordinates(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.public GeneralGridCoordinates(GridCoordinates coordinates)
coordinates
- The grid coordinates to copy.Method Detail |
---|
public int getDimension()
getCoordinateValues().length
. It is
provided for efficienty.
getDimension
in interface GridCoordinates
public 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 GridCoordinates
GeneralGridCoordinates
object.public int getCoordinateValue(int dimension) throws ArrayIndexOutOfBoundsException
getCoordinateValues()[i]
. It is provided for
efficienty.
getCoordinateValue
in interface GridCoordinates
dimension
- 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, UnsupportedOperationException
setCoordinateValue
in interface GridCoordinates
dimension
- The index of the value to set.value
- The new value.
ArrayIndexOutOfBoundsException
- if the specified dimension is out of bounds.
UnsupportedOperationException
- if this grid coordinates is not modifiable.public String toString()
toString
in class Object
public int hashCode()
hashCode
in class Object
public boolean equals(Object object)
equals
in class Object
object
- The object to compares with this grid coordinates.
true
if the given object is equals to this grid coordinates.public GeneralGridCoordinates clone()
clone
in class Object
Object.clone()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |