Spatial DataBlade
JAVA API v8.21

com.ibm.spatial.geom
Class Envelope

java.lang.Object
  extended by com.ibm.spatial.geom.Envelope
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
Envelope.Double, Envelope.Long

public abstract class Envelope
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

The Envelope class describes the extent of a shape defined by a minimum (minX, minY, minZ, minM), and a maximum (maxX, maxY, maxZ, maxM). The Z and M coordinates are optional.

This class is only the abstract superclass for all objects that store an Envelope. The actual storage representation is left to the subclass.

See Also:
Serialized Form

Nested Class Summary
static class Envelope.Double
          The Double class defines a shape envelope specified in double coordinates.
static class Envelope.Long
          The Long class defines an envelope specified in long coordinates.
 
Method Summary
 void add(CoordPoint point)
          Extends this envelope object to contain the point passed as argument.
 void add(double[] xy, int off, int len)
          Adds an array of points represented by sequential xy coordinates to this Envelope.
 void add(double x, double y)
          Adds a point, specified by the double precision arguments x and y, to this Envelope.
 void add(Envelope e)
          Extends this envelope object to contain the envelope passed as argument.
 void addM(double m)
          Adds a measure, specified by the double precision argument m to this Envelope.
 void addM(double[] m, int off, int len)
          Adds an array of m coordinates (measures) to this Envelope.
 void addZ(double z)
          Adds a z coordinate, specified by the double precision argument z to this Envelope.
 void addZ(double[] z, int off, int len)
          Adds an array of z coordinates to this Envelope.
 java.lang.Object clone()
          Return a copy of this object.
abstract  Envelope createIntersection(Envelope e)
          Returns a new Envelope object representing the intersection of this Envelope with the specified Envelope.
abstract  Envelope createUnion(Envelope e)
          Returns a new Envelope object representing the union of this Envelope with the specified Envelope.
 boolean equals(java.lang.Object obj)
          Determines whether or not the specified Object is equal to this Envelope.
 CoordPoint getCenter()
          Returns a point containing the coordinates of the center of this object.
 void getCenter(CoordPoint point)
          Returns the coordinates of the center of this object in the point passed as argument.
 double getMax(int n)
          Returns the maximum n-th coordinate of this Envelope in double precision, where n=0 corresponds to x, n=1 to y, n=2 to z, and n=3 to m.
abstract  double getMaxM()
          Returns the maximum Y coordinate of this Envelope in double precision.
abstract  double getMaxX()
          Returns the maximum X coordinate of this Envelope in double precision.
abstract  double getMaxY()
          Returns the maximum Y coordinate of this Envelope in double precision.
abstract  double getMaxZ()
          Returns the maximum Z coordinate of this Envelope in double precision.
 double getMin(int n)
          Returns the minimum n-th coordinate of this Envelope in double precision, where n=0 corresponds to x, n=1 to y, n=2 to z, and n=3 to m.
abstract  double getMinM()
          Returns the minimum measure of this Envelope in double precision.
abstract  double getMinX()
          Returns the minimum X coordinate of this Envelope in double precision.
abstract  double getMinY()
          Returns the minimum Y coordinate of this Envelope in double precision.
abstract  double getMinZ()
          Returns the minimum Z coordinate of this Envelope in double precision.
 int hashCode()
          Returns the hashcode for this Envelope.
abstract  boolean hasM()
          Determines whether or not this Envelope has a M (measure) extent.
abstract  boolean hasZ()
          Determines whether or not this Envelope has a Z extent.
static void intersect(Envelope src1, Envelope src2, Envelope dest)
          Intersects the pair of specified source Envelope objects and puts the result into the specified destination Envelope object.
 boolean intersects(Envelope e)
          Determines whether this Envelope intersects the argument
abstract  boolean isEmpty()
          Tests whether this Envelope is empty (no extent).
abstract  void setEmpty()
          Sets this Envelope to empty (no extent).
abstract  void setExtent(double minX, double minY, double maxX, double maxY)
          Sets the extent of this Envelope to the specified values.
 void setExtent(Envelope e)
          Sets this Envelope to be the same as the specified Envelope.
abstract  void setExtentM(double minM, double maxM)
          Sets the extent of the M coordinate of this Envelope to the specified values.
abstract  void setExtentZ(double minZ, double maxZ)
          Sets the extent of the Z coordinate of this Envelope to the specified values.
static void union(Envelope src1, Envelope src2, Envelope dest)
          Unions the pair of source Envelope objects and puts the result into the specified destination Envelope object.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getMinX

public abstract double getMinX()
Returns the minimum X coordinate of this Envelope in double precision.

Returns:
the minimum X coordinate of this Envelope.

getMaxX

public abstract double getMaxX()
Returns the maximum X coordinate of this Envelope in double precision.

Returns:
the maximum X coordinate of this Envelope.

getMinY

public abstract double getMinY()
Returns the minimum Y coordinate of this Envelope in double precision.

Returns:
the minimum Y coordinate of this Envelope.

getMaxY

public abstract double getMaxY()
Returns the maximum Y coordinate of this Envelope in double precision.

Returns:
the maximum Y coordinate of this Envelope.

getMinZ

public abstract double getMinZ()
Returns the minimum Z coordinate of this Envelope in double precision.

Returns:
the minimum Z coordinate of this Envelope.

getMaxZ

public abstract double getMaxZ()
Returns the maximum Z coordinate of this Envelope in double precision.

Returns:
the maximum Z coordinate of this Envelope.

getMinM

public abstract double getMinM()
Returns the minimum measure of this Envelope in double precision.

Returns:
the minimum measure of this Envelope.

getMaxM

public abstract double getMaxM()
Returns the maximum Y coordinate of this Envelope in double precision.

Returns:
the maximum Y coordinate of this Envelope.

getMin

public double getMin(int n)
Returns the minimum n-th coordinate of this Envelope in double precision, where n=0 corresponds to x, n=1 to y, n=2 to z, and n=3 to m.

Parameters:
n - the coordinate index
Returns:
the minimum n-th coordinate of this Envelope.

getMax

public double getMax(int n)
Returns the maximum n-th coordinate of this Envelope in double precision, where n=0 corresponds to x, n=1 to y, n=2 to z, and n=3 to m.

Parameters:
n - the coordinate index
Returns:
the maximum n-th coordinate of this Envelope.

getCenter

public void getCenter(CoordPoint point)
Returns the coordinates of the center of this object in the point passed as argument.

Parameters:
point - the point to be filled in with the coordinates of this object's center.

getCenter

public CoordPoint getCenter()
Returns a point containing the coordinates of the center of this object.

Returns:
a point containing the coordinates of the center of this object.

isEmpty

public abstract boolean isEmpty()
Tests whether this Envelope is empty (no extent).

Returns:
true if this object is empty; otherwise, returns false

setEmpty

public abstract void setEmpty()
Sets this Envelope to empty (no extent).


hasZ

public abstract boolean hasZ()
Determines whether or not this Envelope has a Z extent.

Returns:
true if this Envelope has a Z extent; false otherwise.

hasM

public abstract boolean hasM()
Determines whether or not this Envelope has a M (measure) extent.

Returns:
true if this Envelope has a M extent; false otherwise.

setExtent

public abstract void setExtent(double minX,
                               double minY,
                               double maxX,
                               double maxY)
Sets the extent of this Envelope to the specified values.

Parameters:
minX, maxX - the minimum/maximum x coordinate values
minY, maxY - the minimum/maximum y coordinate values

setExtentZ

public abstract void setExtentZ(double minZ,
                                double maxZ)
Sets the extent of the Z coordinate of this Envelope to the specified values.

Parameters:
minZ, maxZ - the minimum/maximum Z coordinate values

setExtentM

public abstract void setExtentM(double minM,
                                double maxM)
Sets the extent of the M coordinate of this Envelope to the specified values.

Parameters:
minM, maxM - the minimum/maximum M coordinate values

setExtent

public void setExtent(Envelope e)
Sets this Envelope to be the same as the specified Envelope.

Parameters:
e - the specified Envelope

createIntersection

public abstract Envelope createIntersection(Envelope e)
Returns a new Envelope object representing the intersection of this Envelope with the specified Envelope.

Parameters:
e - the Envelope that is intersected with this Envelope
Returns:
the largest Envelope contained in both the specified Envelope and in this Envelope.

intersect

public static void intersect(Envelope src1,
                             Envelope src2,
                             Envelope dest)
Intersects the pair of specified source Envelope objects and puts the result into the specified destination Envelope object.

Parameters:
src1 - the first of a pair of Envelope objects to be intersected with each other
src2 - the second of a pair of Envelope objects to be intersected with each other
dest - the Envelope that holds the results of the intersection of src1 and src2

intersects

public boolean intersects(Envelope e)
Determines whether this Envelope intersects the argument

Returns:
true if this Envelope intersects the argument; false otherwise.

createUnion

public abstract Envelope createUnion(Envelope e)
Returns a new Envelope object representing the union of this Envelope with the specified Envelope.

Parameters:
r - the Envelope to be combined with this Envelope
Returns:
the smallest Envelope containing both the specified Envelope and this Envelope.

union

public static void union(Envelope src1,
                         Envelope src2,
                         Envelope dest)
Unions the pair of source Envelope objects and puts the result into the specified destination Envelope object.

Parameters:
src1 - the first of a pair of Envelope objects to be combined with each other
src2 - the second of a pair of Envelope objects to be combined with each other
dest - the Envelope that holds the results of the union of src1 and src2

add

public void add(double x,
                double y)
Adds a point, specified by the double precision arguments x and y, to this Envelope. The resulting Envelope is the smallest Envelope that contains both the original Envelope and the specified point.

Parameters:
x, y - the coordinates of the new point

add

public void add(double[] xy,
                int off,
                int len)
Adds an array of points represented by sequential xy coordinates to this Envelope. The resulting Envelope is the smallest Envelope that contains both the original Envelope and the specified array of points.

Parameters:
xy - array of points in the format {xy}*
off - offset of the first coordinate pair to be used (the position in the array of the first coordinate to be used is 2 * off)
len - the number of coordinate pairs to be used for the calculation
Throws:
java.lang.IndexOutOfBoundsException - if off and len lead to positions out of the xy array bounds

addZ

public void addZ(double z)
Adds a z coordinate, specified by the double precision argument z to this Envelope. The resulting Envelope is the smallest Envelope that contains both the original Envelope and the specified coordinate.

Parameters:
z - the new z coordinate

addZ

public void addZ(double[] z,
                 int off,
                 int len)
Adds an array of z coordinates to this Envelope. The resulting Envelope is the smallest Envelope that contains both the original Envelope and the specified array of z coordinates.

Parameters:
z - array of z coordinates
off - offset of the first coordinate to be used
len - the number of coordinates to be used for the calculation
Throws:
java.lang.IndexOutOfBoundsException - if off and len lead to positions out of the z array bounds

addM

public void addM(double m)
Adds a measure, specified by the double precision argument m to this Envelope. The resulting Envelope is the smallest Envelope that contains both the original Envelope and the specified value.

Parameters:
m - the new measure value

addM

public void addM(double[] m,
                 int off,
                 int len)
Adds an array of m coordinates (measures) to this Envelope. The resulting Envelope is the smallest Envelope that contains both the original Envelope and the specified array of m coordinates.

Parameters:
m - array of m coordinates
off - offset of the first coordinate to be used
len - the number of coordinates to be used for the calculation
Throws:
java.lang.IndexOutOfBoundsException - if off and len lead to positions out of the m array bounds

add

public void add(CoordPoint point)
Extends this envelope object to contain the point passed as argument.

Parameters:
point - the point to add to this object

add

public void add(Envelope e)
Extends this envelope object to contain the envelope passed as argument.

Parameters:
e - the envelope to add to this object

hashCode

public int hashCode()
Returns the hashcode for this Envelope.

Overrides:
hashCode in class java.lang.Object
Returns:
the hashcode for this Envelope.

equals

public boolean equals(java.lang.Object obj)
Determines whether or not the specified Object is equal to this Envelope. The specified Object is equal to this Envelope if it is an instance of Envelope and if its location and size are the same as this Envelope.

Overrides:
equals in class java.lang.Object
Parameters:
obj - an Object to be compared with this Envelope.
Returns:
true if obj is an instance of Envelope and has the same values; false otherwise.

clone

public java.lang.Object clone()
Return a copy of this object.

Overrides:
clone in class java.lang.Object

Spatial DataBlade
JAVA API v8.21


Licensed Materials - Property of IBM
Copyright IBM Corp. 2002, 2012 All Rights Reserved.