Package org.opengis.example.coverage
Class SimpleGridEnvelope
- Object
-
- SimpleGridEnvelope
-
- All Implemented Interfaces:
Serializable
,GridEnvelope
public class SimpleGridEnvelope extends Object implements GridEnvelope, Serializable
AGridEnvelope
implementation which store values in aint[]
array. This class defines a range of grid coverage coordinates.CAUTION: ISO 19123 defines high coordinates as inclusive. We follow this specification for all getters methods, but keep in mind that this is the opposite of Java2D usage where
Rectangle
maximal values are exclusive.- Since:
- 3.1
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SimpleGridEnvelope(long[] low, long[] high)
Constructs a new grid envelope.SimpleGridEnvelope(GridEnvelope envelope)
Creates a new grid envelope as a copy of the given one.
-
Method Summary
Modifier and Type Method Description boolean
equals(Object object)
Compares the specified object with this grid envelope for equality.int
getDimension()
Returns the number of dimensions.GridCoordinates
getHigh()
Returns the valid maximum inclusive grid coordinates.long
getHigh(int dimension)
Returns the valid maximum inclusive grid coordinate along the specified dimension.GridCoordinates
getLow()
Returns the valid minimum inclusive grid coordinates.long
getLow(int dimension)
Returns the valid minimum inclusive grid coordinate along the specified dimension.long
getSize(int dimension)
Returns the number of integer grid coordinates along the specified dimension.int
hashCode()
Returns a hash value for this grid envelope.String
toString()
Returns a string representation of this grid envelope.
-
-
-
Constructor Detail
-
SimpleGridEnvelope
public SimpleGridEnvelope(GridEnvelope envelope)
Creates a new grid envelope as a copy of the given one.- Parameters:
envelope
- the grid envelope to copy.
-
SimpleGridEnvelope
public SimpleGridEnvelope(long[] low, long[] high)
Constructs a new grid envelope.- Parameters:
low
- the valid minimum inclusive grid coordinate. The array contains a minimum value (inclusive) for each dimension of the grid coverage. The lowest valid grid coordinate is often zero, but this is not mandatory.high
- the valid maximum grid coordinate, inclusive. The array contains a maximum value for each dimension of the grid coverage.- See Also:
getLow()
,getHigh()
-
-
Method Detail
-
getDimension
public int getDimension()
Returns the number of dimensions.- Specified by:
getDimension
in interfaceGridEnvelope
-
getLow
public GridCoordinates getLow()
Returns the valid minimum inclusive grid coordinates. The sequence contains a minimum value for each dimension of the grid coverage.- Specified by:
getLow
in interfaceGridEnvelope
-
getHigh
public GridCoordinates getHigh()
Returns the valid maximum inclusive grid coordinates. The sequence contains a maximum value for each dimension of the grid coverage.- Specified by:
getHigh
in interfaceGridEnvelope
-
getLow
public long getLow(int dimension)
Returns the valid minimum inclusive grid coordinate along the specified dimension.- Specified by:
getLow
in interfaceGridEnvelope
- See Also:
getLow()
-
getHigh
public long getHigh(int dimension)
Returns the valid maximum inclusive grid coordinate along the specified dimension.- Specified by:
getHigh
in interfaceGridEnvelope
- See Also:
getHigh()
-
getSize
public long getSize(int dimension)
Returns the number of integer grid coordinates along the specified dimension. This is equal togetHigh(dimension) - getLow(dimension) + 1
.- Specified by:
getSize
in interfaceGridEnvelope
-
hashCode
public int hashCode()
Returns a hash value for this grid envelope. This value need not remain consistent between different implementations of the same class.
-
equals
public boolean equals(Object object)
Compares the specified object with this grid envelope for equality.
-
-