oracle.sdoapi.geom
Class EnvelopeImpl

java.lang.Object
  |
  +--oracle.sdoapi.geom.EnvelopeImpl
All Implemented Interfaces:
java.lang.Cloneable, Envelope, java.io.Serializable

public class EnvelopeImpl
extends java.lang.Object
implements Envelope

EnvelopeImpl is a helper class that represents a 2D OGC-specified envelope, that is, a Minimum Bounding Rectangle of a geometry object.

See Also:
Serialized Form

Constructor Summary
EnvelopeImpl()
          Constructs a default envelope (MBR) that is empty.
EnvelopeImpl(CoordPoint point)
          Constructs an envelope (MBR) for a coordinate point.
EnvelopeImpl(CoordPoint min, CoordPoint max)
          Constructs an envelope (MBR) with lower-left and upper-right corner coordinate points.
EnvelopeImpl(double xMin, double yMin, double xMax, double yMax)
          Constructs an envelope (MBR) with lower-left and upper-right coordinates.
EnvelopeImpl(double xMin, double yMin, double zMin, double xMax, double yMax, double zMax)
          Constructs an envelope (MBR) with 3-D coordinates.
EnvelopeImpl(Envelope envelope)
          Copy constructor
EnvelopeImpl(Point point)
          Constructs an envelope (MBR) for a geometric point.
 
Method Summary
 java.lang.Object clone()
          Clones this envelope to generate another envelope object.
 boolean contains(CoordPoint point)
          Determines if this envelope object (MBR) contains the input coordinate point.
 boolean contains(double x, double y)
          Determines if this envelope object (MBR) contains the input (x, y) coordinate.
 boolean contains(double x, double y, double z)
          Determines if this envelope object (MBR) contains the input (x, y) coordinate.
 boolean contains(Envelope envelope)
          Determines if this envelope object (MBR) contains the input envelope.
 Envelope expand(CoordPoint point)
          Expands this envelope object (MBR) to contain the input coordinate point.
 Envelope expand(double x, double y)
          Expands this envelope object (MBR) to contain the input coordinates.
 Envelope expand(double x, double y, double z)
          Expands this envelope object (MBR) to contain the input coordinates.
 Envelope expand(Envelope envelope)
          Expands this envelope object (MBR) to contain the input envelope.
 Envelope expandBy(double w, double h)
          Expands this envelope by w amount in X-axis (w/2 on each side); also expands by h amount in Y-axis (h/2 on each side).
 double getHeight()
          Gets the height of this envelope (MBR).
 CoordPoint getLowerLeft()
          Gets the lower-left coordinate point.
 void getLowerLeft(CoordPoint point)
          Gets the lower-left coordinate point.
 double getMaxOrd(int i)
          Gets the i-th ordinate of upper-right corner.
 double getMaxX()
          Gets the x coordinate of upper-right corner.
 double getMaxY()
          Gets the y coordinate of upper-right corner.
 double getMinOrd(int i)
          Gets the i-th ordinate of lower-left corner.
 double getMinX()
          Gets the x coordinate of lower-left corner.
 double getMinY()
          Gets the y coordinate of lower-left corner.
 CoordPoint getUpperRight()
          Gets the upper-right coordinate point.
 void getUpperRight(CoordPoint point)
          Gets the upper-right coordinate point.
 double getWidth()
          Gets the width of this envelope (MBR).
 boolean isEmpty()
          Determines if this envelope is empty, that is, if the lower-left corner has x, y coordinates greater than the x, y coordinates of the upper-right corner, respectively.
 boolean overlaps(Envelope envelope)
          Determines if two envelopes (MBRs) overlaps with each other.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EnvelopeImpl

public EnvelopeImpl()
Constructs a default envelope (MBR) that is empty.

EnvelopeImpl

public EnvelopeImpl(Point point)
Constructs an envelope (MBR) for a geometric point.
Parameters:
point - the input geometric point

EnvelopeImpl

public EnvelopeImpl(CoordPoint point)
Constructs an envelope (MBR) for a coordinate point. (Unlike a geometric point, a coordinate point is not a geometry, but a part of some geometric object.)
Parameters:
point - the input coordinate point

EnvelopeImpl

public EnvelopeImpl(CoordPoint min,
                    CoordPoint max)
Constructs an envelope (MBR) with lower-left and upper-right corner coordinate points.
Parameters:
min - the lower-left coordinate point
max - the upper-right coordinate point

EnvelopeImpl

public EnvelopeImpl(double xMin,
                    double yMin,
                    double xMax,
                    double yMax)
Constructs an envelope (MBR) with lower-left and upper-right coordinates.
Parameters:
xMin - x coordinate of the lower-left corner
yMin - y coordinate of the lower-left corner
xMax - x coordinate of the upper-right corner
yMax - y coordinate of the upper-right corner

EnvelopeImpl

public EnvelopeImpl(double xMin,
                    double yMin,
                    double zMin,
                    double xMax,
                    double yMax,
                    double zMax)
Constructs an envelope (MBR) with 3-D coordinates.
Parameters:
xMin - x coordinate of the lower-left corner
yMin - y coordinate of the lower-left corner
zMin - z coordinate of the lower-left corner
xMax - x coordinate of the upper-right corner
yMax - y coordinate of the upper-right corner
yMax - z coordinate of the upper-right corner

EnvelopeImpl

public EnvelopeImpl(Envelope envelope)
Copy constructor
Method Detail

getMinX

public final double getMinX()
Gets the x coordinate of lower-left corner.
Specified by:
getMinX in interface Envelope
Returns:
the x coordinate of lower-left corner

getMinY

public final double getMinY()
Gets the y coordinate of lower-left corner.
Specified by:
getMinY in interface Envelope
Returns:
the y coordinate of lower-left corner

getMinOrd

public final double getMinOrd(int i)
Gets the i-th ordinate of lower-left corner.
Specified by:
getMinOrd in interface Envelope
Parameters:
i - the 0-based index of the ordinates. For example, i = 0 means the first dimension (or x by convention), etc.
Returns:
the i-th ordinate of lower-left corner, or Double.NaN if the i-th ordinate is not available

getMaxX

public final double getMaxX()
Gets the x coordinate of upper-right corner.
Specified by:
getMaxX in interface Envelope
Returns:
the x coordinate of upper-right corner

getMaxY

public final double getMaxY()
Gets the y coordinate of upper-right corner.
Specified by:
getMaxY in interface Envelope
Returns:
the y coordinate of upper-right corner

getMaxOrd

public final double getMaxOrd(int i)
Gets the i-th ordinate of upper-right corner.
Specified by:
getMaxOrd in interface Envelope
Parameters:
i - the 0-based index of the ordinates. For example, i = 0 means the first dimension (or x by convention), etc.
Returns:
the i-th ordinate of upper-right corner, or Double.NaN if the i-th ordinate is not available

getLowerLeft

public final CoordPoint getLowerLeft()
Gets the lower-left coordinate point.
Specified by:
getLowerLeft in interface Envelope
Returns:
the lower-left coordinate point

getLowerLeft

public final void getLowerLeft(CoordPoint point)
Gets the lower-left coordinate point. This method may be more memory efficient when you can reuse the coordinate point object.
Specified by:
getLowerLeft in interface Envelope
Parameters:
point - a preallocated coordinate point that is to be filled with the ordinates of the lower-left coordinate point

getUpperRight

public final CoordPoint getUpperRight()
Gets the upper-right coordinate point.
Specified by:
getUpperRight in interface Envelope
Returns:
the upper-right coordinate point

getUpperRight

public final void getUpperRight(CoordPoint point)
Gets the upper-right coordinate point. This method may be more memory efficient when you can reuse the coordinate point object.
Specified by:
getUpperRight in interface Envelope
Parameters:
point - a preallocated coordinate point that is to be filled with the ordinates of the upper-right coordinate point.

isEmpty

public final boolean isEmpty()
Determines if this envelope is empty, that is, if the lower-left corner has x, y coordinates greater than the x, y coordinates of the upper-right corner, respectively.
Specified by:
isEmpty in interface Envelope
Returns:
true if this envelope is valid; false otherwise

getWidth

public final double getWidth()
Gets the width of this envelope (MBR).
Specified by:
getWidth in interface Envelope
Returns:
the width of this envelope

getHeight

public final double getHeight()
Gets the height of this envelope (MBR).
Specified by:
getHeight in interface Envelope
Returns:
the height of this envelope

contains

public final boolean contains(CoordPoint point)
Determines if this envelope object (MBR) contains the input coordinate point.
Specified by:
contains in interface Envelope
Parameters:
point - the coordinate point to test containment against
Returns:
true if this envelope contains the input point; false otherwise

contains

public final boolean contains(double x,
                              double y)
Determines if this envelope object (MBR) contains the input (x, y) coordinate.
Specified by:
contains in interface Envelope
Parameters:
x - the x coordinate of the point to test containment against
y - the y coordinate of the point to test containment against
Returns:
true if this envelope contains the input coordinate; false otherwise

contains

public final boolean contains(double x,
                              double y,
                              double z)
Determines if this envelope object (MBR) contains the input (x, y) coordinate.
Parameters:
x - the x coordinate of the point to test containment against
y - the y coordinate of the point to test containment against
z - the z coordinate of the point to test containment against
Returns:
true if this envelope contains the input coordinate; false otherwise

contains

public final boolean contains(Envelope envelope)
Determines if this envelope object (MBR) contains the input envelope.
Specified by:
contains in interface Envelope
Parameters:
envelope - the envelope to test containment against
Returns:
true if this envelope contains the input envelope; false otherwise

overlaps

public final boolean overlaps(Envelope envelope)
Determines if two envelopes (MBRs) overlaps with each other.
Specified by:
overlaps in interface Envelope
Parameters:
envelope - the envelope to test against
Returns:
true if this envelope overlaps with the input envelope; false otherwise

expand

public final Envelope expand(CoordPoint point)
Expands this envelope object (MBR) to contain the input coordinate point.
Specified by:
expand in interface Envelope
Parameters:
point - the coordinate point to expand this envelope
Returns:
this expanded envelope

expand

public final Envelope expand(double x,
                             double y)
Expands this envelope object (MBR) to contain the input coordinates.
Specified by:
expand in interface Envelope
Parameters:
x - the x coordinate of the point to expand this envelope
y - the y coordinate of the point to expand this envelope
Returns:
this expanded envelope

expand

public final Envelope expand(double x,
                             double y,
                             double z)
Expands this envelope object (MBR) to contain the input coordinates.
Parameters:
x - the x coordinate of the point to expand this envelope
y - the y coordinate of the point to expand this envelope
z - the z coordinate of the point to expand this envelope
Returns:
this expanded envelope

expand

public final Envelope expand(Envelope envelope)
Expands this envelope object (MBR) to contain the input envelope.
Specified by:
expand in interface Envelope
Parameters:
envelope - the envelope to expand this envelope
Returns:
this expanded envelope

expandBy

public Envelope expandBy(double w,
                         double h)
Expands this envelope by w amount in X-axis (w/2 on each side); also expands by h amount in Y-axis (h/2 on each side).
Specified by:
expandBy in interface Envelope

clone

public final java.lang.Object clone()
                             throws java.lang.CloneNotSupportedException
Description copied from interface: Envelope
Clones this envelope to generate another envelope object.
Specified by:
clone in interface Envelope
Overrides:
clone in class java.lang.Object
Following copied from interface: oracle.sdoapi.geom.Envelope
Returns:
a envelope object with the same content as in this envelope

toString

public final java.lang.String toString()
Overrides:
toString in class java.lang.Object