org.geotoolkit.geometry
Class ImmutableEnvelope

Object
  extended by AbstractEnvelope
      extended by ImmutableEnvelope
All Implemented Interfaces:
Envelope

@Immutable
public final class ImmutableEnvelope
extends AbstractEnvelope

Immutable representation of an envelope. This class is final in order to ensure that the immutability contract can not be broken (assuming not using Java Native Interface or reflections).

Since:
3.00
Version:
3.00
Author:
Cédric Briançon (Geomatys), Martin Desruisseaux (Geomatys)
Module:
referencing/geotk-referencing (download)    View source code for this class

Constructor Summary
ImmutableEnvelope(CoordinateReferenceSystem crs, double xmin, double xmax, double ymin, double ymax)
          Builds a two-dimensional envelope with the specified bounds.
ImmutableEnvelope(Envelope envelope)
          Creates an immutable envelope with the values of the given envelope.
 
Method Summary
 CoordinateReferenceSystem getCoordinateReferenceSystem()
          Returns the envelope coordinate reference system, or null if unknown.
 int getDimension()
          The length of coordinate sequence (the number of entries) in this envelope.
 double getMaximum(int dimension)
          Returns the maximal ordinate along the specified dimension.
 double getMedian(int dimension)
          Returns the median ordinate along the specified dimension.
 double getMinimum(int dimension)
          Returns the minimal ordinate along the specified dimension.
 double getSpan(int dimension)
          Returns the envelope span (typically width or height) along the specified dimension.
 
Methods inherited from class AbstractEnvelope
equals, equals, getLowerCorner, getUpperCorner, hashCode, toPolygonString, toString, toString
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ImmutableEnvelope

public ImmutableEnvelope(Envelope envelope)
Creates an immutable envelope with the values of the given envelope.

Parameters:
envelope - The envelope to copy.

ImmutableEnvelope

public ImmutableEnvelope(CoordinateReferenceSystem crs,
                         double xmin,
                         double xmax,
                         double ymin,
                         double ymax)
Builds a two-dimensional envelope with the specified bounds.

Parameters:
crs - The coordinate reference system, or null if none.
xmin - The minimal value for the first ordinate.
xmax - The maximal value for the first ordinate.
ymin - The minimal value for the second ordinate.
ymax - The maximal value for the second ordinate.
Method Detail

getCoordinateReferenceSystem

public CoordinateReferenceSystem getCoordinateReferenceSystem()
Returns the envelope coordinate reference system, or null if unknown.


getDimension

public int getDimension()
The length of coordinate sequence (the number of entries) in this envelope.


getMinimum

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

Throws:
IndexOutOfBoundsException - If the given index is out of bounds.

getMaximum

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

Throws:
IndexOutOfBoundsException - If the given index is out of bounds.

getMedian

public double getMedian(int dimension)
                 throws IndexOutOfBoundsException
Returns the median ordinate along the specified dimension.

Throws:
IndexOutOfBoundsException - If the given index is out of bounds.

getSpan

public double getSpan(int dimension)
               throws IndexOutOfBoundsException
Returns the envelope span (typically width or height) along the specified dimension.

Throws:
IndexOutOfBoundsException - If the given index is out of bounds.


Copyright © 2009-2011 Geotoolkit.org. All Rights Reserved.