Package org.opengis.example.coverage
Class SimpleGridEnvelope
- Object
-
- SimpleGridEnvelope
-
- All Implemented Interfaces:
Serializable,GridEnvelope
public class SimpleGridEnvelope extends Object implements GridEnvelope, Serializable
AGridEnvelopeimplementation 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
Rectanglemaximal 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 booleanequals(Object object)Compares the specified object with this grid envelope for equality.intgetDimension()Returns the number of dimensions.GridCoordinatesgetHigh()Returns the valid maximum inclusive grid coordinates.longgetHigh(int dimension)Returns the valid maximum inclusive grid coordinate along the specified dimension.GridCoordinatesgetLow()Returns the valid minimum inclusive grid coordinates.longgetLow(int dimension)Returns the valid minimum inclusive grid coordinate along the specified dimension.longgetSize(int dimension)Returns the number of integer grid coordinates along the specified dimension.inthashCode()Returns a hash value for this grid envelope.StringtoString()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:
getDimensionin 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:
getLowin 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:
getHighin interfaceGridEnvelope
-
getLow
public long getLow(int dimension)
Returns the valid minimum inclusive grid coordinate along the specified dimension.- Specified by:
getLowin interfaceGridEnvelope- See Also:
getLow()
-
getHigh
public long getHigh(int dimension)
Returns the valid maximum inclusive grid coordinate along the specified dimension.- Specified by:
getHighin 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:
getSizein 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.
-
-