|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.deegree_impl.model.pt.Envelope
A box defined by two positions. The two positions must have the same dimension. Each of the ordinate values in the minimum point must be less than or equal to the corresponding ordinate value in the maximum point. Please note that these two points may be outside the valid domain of their coordinate system. (Of course the points and envelope do not explicitly reference a coordinate system, but their implicit coordinate system is defined by their context.)
PT_Envelope
,
Rectangle2D
,
Serialized FormField Summary | |
private double[] |
ord
Minimum and maximum ordinate values. |
private static long |
serialVersionUID
Serial number for interoperability with different versions. |
Constructor Summary | |
|
Envelope(CoordinatePoint minCP,
CoordinatePoint maxCP)
Construct a envelope defined by two positions. |
|
Envelope(double[] minCP,
double[] maxCP)
Construct a envelope defined by two positions. |
|
Envelope(double min,
double max)
Construct one-dimensional envelope defined by a range of values. |
private |
Envelope(Envelope envelope)
Construct a copy of the specified envelope. |
|
Envelope(int dimension)
Construct an empty envelope of the specified dimension. |
|
Envelope(java.awt.geom.Rectangle2D rect)
Construct two-dimensional envelope defined by a Rectangle2D . |
Method Summary | |
void |
add(CoordinatePoint point)
Adds a point to this envelope. |
void |
add(Envelope envelope)
Adds an envelope object to this envelope. |
private void |
checkCoherence()
Check if ordinate values in the minimum point are less than or equal to the corresponding ordinate value in the maximum point. |
java.lang.Object |
clone()
Returns a deep copy of this envelope. |
boolean |
contains(CoordinatePoint point)
Tests if a specified coordinate is inside the boundary of this envelope. |
Envelope |
createIntersection(Envelope envelope)
Returns a new envelope representing the intersection of this Envelope with the specified Envelope . |
(package private) void |
ensureDimensionMatch(int expectedDimension)
Convenience method for checking the envelope's dimension validity. |
boolean |
equals(java.lang.Object object)
Compares the specified object with this envelope for equality. |
double |
getCenter(int dimension)
Returns the center ordinate along the specified dimension. |
int |
getDimension()
Returns the number of dimensions. |
double |
getLength(int dimension)
Returns the envelope length along the specified dimension. |
double |
getMaximum(int dimension)
Returns the maximal ordinate along the specified dimension. |
double |
getMinimum(int dimension)
Returns the minimal ordinate along the specified dimension. |
Envelope |
getSubEnvelope(int lower,
int upper)
Returns a new envelope that encompass only some dimensions of this envelope. |
int |
hashCode()
Returns a hash value for this envelope. |
boolean |
isEmpty()
Determines whether or not this envelope is empty. |
void |
setRange(int dimension,
double minimum,
double maximum)
Set the envelope's range along the specified dimension. |
java.awt.geom.Rectangle2D |
toRectangle2D()
Returns a Rectangle2D with the same bounds as this Envelope .
|
java.lang.String |
toString()
Returns a string representation of this envelope. |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final long serialVersionUID
private final double[] ord
Constructor Detail |
private Envelope(Envelope envelope)
public Envelope(int dimension)
public Envelope(double min, double max)
min
- The minimal value.max
- The maximal value.public Envelope(double[] minCP, double[] maxCP) throws MismatchedDimensionException
minCP
- Minimum ordinate values.maxCP
- Maximum ordinate values.
MismatchedDimensionException
- if the two positions don't have the same dimension.
java.lang.IllegalArgumentException
- if an ordinate value in the minimum point is not
less than or equal to the corresponding ordinate value in the maximum point.public Envelope(CoordinatePoint minCP, CoordinatePoint maxCP) throws MismatchedDimensionException
minCP
- Point containing minimum ordinate values.maxCP
- Point containing maximum ordinate values.
MismatchedDimensionException
- if the two positions don't have the same dimension.
java.lang.IllegalArgumentException
- if an ordinate value in the minimum point is not
less than or equal to the corresponding ordinate value in the maximum point.public Envelope(java.awt.geom.Rectangle2D rect)
Rectangle2D
.
Method Detail |
private void checkCoherence() throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
- if an ordinate value in the minimum point is not
less than or equal to the corresponding ordinate value in the maximum point.void ensureDimensionMatch(int expectedDimension) throws MismatchedDimensionException
expectedDimension
- Expected dimension for this envelope.
MismatchedDimensionException
- if this envelope doesn't have the expected dimension.public boolean isEmpty()
public int getDimension()
getDimension
in interface Dimensioned
public double getMinimum(int dimension)
public double getMaximum(int dimension)
public double getCenter(int dimension)
public double getLength(int dimension)
public void setRange(int dimension, double minimum, double maximum)
dimension
- The dimension to set.minimum
- The minimum value along the specified dimension.maximum
- The maximum value along the specified dimension.public void add(CoordinatePoint point) throws MismatchedDimensionException
contains(org.deegree_impl.model.pt.CoordinatePoint)
with the
added point as an argument will return true
, except if one of
the point's ordinates was Double.NaN
(in which case the corresponding
ordinate have been ignored).
point
- The point to add.
MismatchedDimensionException
- if the specified point doesn't have
the expected dimension.public void add(Envelope envelope) throws MismatchedDimensionException
Envelope
objects.
envelope
- the Envelope
to add to this envelope.
MismatchedDimensionException
- if the specified envelope doesn't
have the expected dimension.public boolean contains(CoordinatePoint point) throws MismatchedDimensionException
point
- The point to text.
true
if the specified coordinates are inside the boundary
of this envelope; false
otherwise.
MismatchedDimensionException
- if the specified point doesn't have
the expected dimension.public Envelope createIntersection(Envelope envelope) throws MismatchedDimensionException
Envelope
with the specified Envelope
.
envelope
- The Envelope
to intersect with this envelope.
Envelope
and in this Envelope
.
MismatchedDimensionException
- if the specified envelope doesn't
have the expected dimension.public Envelope getSubEnvelope(int lower, int upper)
lower
and extending to dimension upper-1
.
Thus the dimension of the subenvelope is upper-lower
.
lower
- The first dimension to copy, inclusive.upper
- The last dimension to copy, exclusive.
java.lang.IndexOutOfBoundsException
- if an index is out of bounds.public java.awt.geom.Rectangle2D toRectangle2D() throws java.lang.IllegalStateException
Rectangle2D
with the same bounds as this Envelope
.
This is a convenience method for interoperability with Java2D.
java.lang.IllegalStateException
- if this envelope is not two-dimensional.public int hashCode()
public boolean equals(java.lang.Object object)
public java.lang.Object clone()
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |