org.gvsig.fmap.geom.primitive.impl
Class DefaultEnvelope

java.lang.Object
  extended by org.gvsig.fmap.geom.primitive.impl.DefaultEnvelope
All Implemented Interfaces:
Cloneable, Envelope, Persistent
Direct Known Subclasses:
Envelope2D, Envelope3D

public abstract class DefaultEnvelope
extends Object
implements Envelope, Cloneable

A minimum bounding box or rectangle. Regardless of dimension, an Envelope can be represented without ambiguity as two direct positions (coordinate points). To encode an Envelope, it is sufficient to encode these two points. This is consistent with all of the data types in this specification, their state is represented by their publicly accessible attributes.

Author:
Vicente Caballero Navarro

Field Summary
protected  boolean isEmpty
           
protected static String LOWERCORNER_FIELD
           
protected static GeometryManager manager
           
protected  Point max
           
protected  Point min
           
static String PERSISTENCE_DEFINITION_NAME
           
protected static String UPPERCORNER_FIELD
           
 
Constructor Summary
DefaultEnvelope()
           
DefaultEnvelope(Point min, Point max)
           
 
Method Summary
 void add(Envelope envelope)
          Adds a envelope to the current envelope.
 Object clone()
           
 boolean contains(Envelope envelope)
          Returns true if the new envelope is contained in the current envelope.
 boolean equals(Object other)
           
 double getCenter(int dimension)
          Returns the center ordinate along the specified dimension.
 Geometry getGeometry()
          It returns the equivalent of an envelope like a geometry.
 double getLength(int dimension)
          Returns the envelope length along the specified dimension.
 Point getLowerCorner()
          A coordinate position consisting of all the minimal ordinates for each dimension for all points within the Envelope.
 double getMaximum(int dimension)
          Returns the maximal ordinate along the specified dimension.
 double getMinimum(int dimension)
          Returns the minimal ordinate along the specified dimension.
 Point getUpperCorner()
          A coordinate position consisting of all the maximal ordinates for each dimension for all points within the Envelope.
 boolean intersects(Envelope envelope)
          Returns true if the new envelope intersects with the current envelope.
 boolean isEmpty()
          Gets if the envelope is null or not.
 void loadFromState(PersistentState state)
           
static void registerPersistent()
           
 void saveToState(PersistentState state)
           
 void setLowerCorner(Point lowerCorner)
          Sets the coordinate position consisting of all the minimal ordinates for each dimension for all points within the Envelope.
 void setUpperCorner(Point upperCorner)
          Sets the coordinate position consisting of all the maximal ordinates for each dimension for all points within the Envelope.
 String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.gvsig.fmap.geom.primitive.Envelope
convert, getDimension
 

Field Detail

PERSISTENCE_DEFINITION_NAME

public static final String PERSISTENCE_DEFINITION_NAME
See Also:
Constant Field Values

LOWERCORNER_FIELD

protected static final String LOWERCORNER_FIELD
See Also:
Constant Field Values

UPPERCORNER_FIELD

protected static final String UPPERCORNER_FIELD
See Also:
Constant Field Values

min

protected Point min

max

protected Point max

isEmpty

protected boolean isEmpty

manager

protected static GeometryManager manager
Constructor Detail

DefaultEnvelope

public DefaultEnvelope()

DefaultEnvelope

public DefaultEnvelope(Point min,
                       Point max)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

getCenter

public double getCenter(int dimension)
Returns the center ordinate along the specified dimension.

Specified by:
getCenter in interface Envelope
Parameters:
dimension - DOCUMENT ME!
Returns:
DOCUMENT ME!

getLength

public double getLength(int dimension)
Returns the envelope length along the specified dimension.

Specified by:
getLength in interface Envelope
Parameters:
dimension -
Returns:

getLowerCorner

public Point getLowerCorner()
A coordinate position consisting of all the minimal ordinates for each dimension for all points within the Envelope.

Specified by:
getLowerCorner in interface Envelope
Returns:

getMaximum

public double getMaximum(int dimension)
Returns the maximal ordinate along the specified dimension.

Specified by:
getMaximum in interface Envelope
Parameters:
dimension -
Returns:

getMinimum

public double getMinimum(int dimension)
Returns the minimal ordinate along the specified dimension.

Specified by:
getMinimum in interface Envelope
Parameters:
dimension -
Returns:

getUpperCorner

public Point getUpperCorner()
A coordinate position consisting of all the maximal ordinates for each dimension for all points within the Envelope.

Specified by:
getUpperCorner in interface Envelope
Returns:

add

public void add(Envelope envelope)
Description copied from interface: Envelope
Adds a envelope to the current envelope.

Specified by:
add in interface Envelope
Parameters:
envelope - The envelope to add.

getGeometry

public Geometry getGeometry()
Description copied from interface: Envelope
It returns the equivalent of an envelope like a geometry.

Specified by:
getGeometry in interface Envelope
Returns:
A geometry that contains the same area that the envelope.

contains

public boolean contains(Envelope envelope)
Description copied from interface: Envelope
Returns true if the new envelope is contained in the current envelope.

Specified by:
contains in interface Envelope
Parameters:
envelope - The envelope to compare.
Returns:
If the current envelope contains the new envelope

intersects

public boolean intersects(Envelope envelope)
Description copied from interface: Envelope
Returns true if the new envelope intersects with the current envelope.

Specified by:
intersects in interface Envelope
Parameters:
envelope - The envelope to compare.
Returns:
If the current envelope intersects with the new envelope

equals

public boolean equals(Object other)
Overrides:
equals in class Object

setLowerCorner

public void setLowerCorner(Point lowerCorner)
Description copied from interface: Envelope
Sets the coordinate position consisting of all the minimal ordinates for each dimension for all points within the Envelope.

Specified by:
setLowerCorner in interface Envelope
Parameters:
lowerCorner - The lower corner.

setUpperCorner

public void setUpperCorner(Point upperCorner)
Description copied from interface: Envelope
Sets the coordinate position consisting of all the maximal ordinates for each dimension for all points within the Envelope.

Specified by:
setUpperCorner in interface Envelope

registerPersistent

public static void registerPersistent()

loadFromState

public void loadFromState(PersistentState state)
                   throws PersistenceException
Specified by:
loadFromState in interface Persistent
Throws:
PersistenceException

saveToState

public void saveToState(PersistentState state)
                 throws PersistenceException
Specified by:
saveToState in interface Persistent
Throws:
PersistenceException

clone

public Object clone()
             throws CloneNotSupportedException
Overrides:
clone in class Object
Throws:
CloneNotSupportedException

isEmpty

public boolean isEmpty()
Description copied from interface: Envelope
Gets if the envelope is null or not. Is Empty means that the lower and upper corner are null.

Specified by:
isEmpty in interface Envelope
Returns:
null or not if is empty.


Copyright © 2004-2012 gvSIG. All Rights Reserved.