Package org.geotools.geometry
Class AbstractBounds
- Object
-
- AbstractBounds
-
- All Implemented Interfaces:
Bounds
- Direct Known Subclasses:
GeneralBounds
public abstract class AbstractBounds extends Object implements Bounds
Base class for envelope implementations. This base class provides default implementations fortoString()
,equals(java.lang.Object)
andhashCode()
methods.This class do not holds any state. The decision to implement
Serializable
ororg.geotools.util.Cloneable
interfaces is left to implementors.- Since:
- 2.4
- Author:
- Martin Desruisseaux (IRD)
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractBounds()
Constructs an envelope.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object object)
Returnstrue
if the specified object is also an envelope with equals coordinates and CRS.Position
getLowerCorner()
A coordinate position consisting of all the minimal ordinates.Position
getUpperCorner()
A coordinate position consisting of all the maximal ordinates.int
hashCode()
Returns a hash value for this envelope.String
toString()
Returns a string representation of this envelope.-
Methods inherited from interface Bounds
getCoordinateReferenceSystem, getDimension, getMaximum, getMedian, getMinimum, getSpan
-
-
-
-
Method Detail
-
getLowerCorner
public Position getLowerCorner()
A coordinate position consisting of all the minimal ordinates. The default implementation returns a direct position backed by this envelope, so changes in this envelope will be immediately reflected in the direct position.- Specified by:
getLowerCorner
in interfaceBounds
- Returns:
- The lower corner.
-
getUpperCorner
public Position getUpperCorner()
A coordinate position consisting of all the maximal ordinates. The default implementation returns a direct position backed by this envelope, so changes in this envelope will be immediately reflected in the direct position.- Specified by:
getUpperCorner
in interfaceBounds
- Returns:
- The upper corner.
-
toString
public String toString()
Returns a string representation of this envelope. The default implementation returns a string containing lower corner coordinates first, followed by upper corner coordinates. Other informations like the CRS or class name may or may not be presents at implementor choice.This string is okay for occasional formatting (for example for debugging purpose). But if there is a lot of envelopes to format, users will get more control by using their own instance of
CoordinateFormat
.
-
hashCode
public int hashCode()
Returns a hash value for this envelope.
-
-