public class GeneralGridCoordinates extends Object implements GridCoordinates, Serializable
GridCoordinates2D
,
Serialized FormModifier and Type | Class and Description |
---|---|
static class |
GeneralGridCoordinates.Immutable
An immutable
GridCoordinates . |
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
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.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()
public int hashCode()
public boolean equals(Object object)
public GeneralGridCoordinates clone()
clone
in class Object
Object.clone()
Copyright © 1996–2019 Geotools. All rights reserved.