org.kaboum.geom
Class KaboumGeometry

java.lang.Object
  extended by org.kaboum.geom.KaboumGeometry
Direct Known Subclasses:
KaboumGeometryCollection, KaboumLineString, KaboumPoint, KaboumPolygon

public abstract class KaboumGeometry
extends java.lang.Object

This class define a geometry i.e. a geometrical object such as a Point, a Linestring or a polygon object.

Author:
Jérôme Gasperi aka jrom

Field Summary
static java.lang.String WKT_LINESTRING
           
static java.lang.String WKT_POINT
          CONSTANTS Definition
static java.lang.String WKT_POLYGON
           
 
Constructor Summary
KaboumGeometry()
           
 
Method Summary
 void addCoordinate(KaboumCoordinate internal)
           
 void addCoordinateInGeometryN(KaboumCoordinate internal, int i)
           
 java.lang.Object clone()
          Perform an exact copy of this object
abstract  boolean equalsExact(KaboumGeometry other)
           
abstract  double getArea()
           
abstract  KaboumCoordinate[] getCoordinates()
          Returns this Geometry s vertices.
abstract  int getDimension()
           
abstract  KaboumExtent getExtent()
           
abstract  KaboumCoordinate[] getExteriorCoordinates()
          Returns this Geometry s exterior vertices.
abstract  int getExteriorNumPoints()
           
 KaboumGeometry getGeometryN(int n)
          Return the number og geometries
abstract  java.lang.String getGeometryType()
           
 int getNumGeometries()
          Return the number og geometries
abstract  int getNumPoints()
          Returns the count of this Geometrys vertices.
abstract  double getPerimeter()
           
protected static boolean hasNonEmptyElements(KaboumGeometry[] geometries)
          Returns true if the array contains any non-empty Geometrys.
protected static boolean hasNullElements(java.lang.Object[] array)
          Returns true if the array contains any null elements.
protected static int indexOf(KaboumCoordinate coordinate, KaboumCoordinate[] coordinates)
          Returns the index of coordinate in coordinates.
abstract  boolean isClosed()
           
abstract  boolean isEmpty()
           
protected  boolean isEquivalentClass(KaboumGeometry other)
          Return true if this geometry got the same class of other geometry
protected static KaboumCoordinate minCoordinate(KaboumCoordinate[] coordinates)
          Returns the minimum coordinate.
abstract  void normalize()
           
 boolean removeGeometry(KaboumGeometry inputGeometry)
          Always returns false
protected static void reversePointOrder(KaboumCoordinate[] coordinates)
          Flips the positions of the elements in the array so that the last is first.
protected static void scroll(KaboumCoordinate[] coordinates, KaboumCoordinate firstCoordinate)
          Shifts the positions of the coordinates until firstCoordinate is first.
abstract  boolean setCoordinates(KaboumCoordinate[] internals)
          Fill a SIMPLE geometry with input coordinates list
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WKT_POINT

public static final java.lang.String WKT_POINT
CONSTANTS Definition

See Also:
Constant Field Values

WKT_LINESTRING

public static final java.lang.String WKT_LINESTRING
See Also:
Constant Field Values

WKT_POLYGON

public static final java.lang.String WKT_POLYGON
See Also:
Constant Field Values
Constructor Detail

KaboumGeometry

public KaboumGeometry()
Method Detail

isEquivalentClass

protected boolean isEquivalentClass(KaboumGeometry other)
Return true if this geometry got the same class of other geometry


reversePointOrder

protected static void reversePointOrder(KaboumCoordinate[] coordinates)
Flips the positions of the elements in the array so that the last is first.

Parameters:
coordinates - the array to rearrange

minCoordinate

protected static KaboumCoordinate minCoordinate(KaboumCoordinate[] coordinates)
Returns the minimum coordinate.

Parameters:
coordinates - the array to search in
Returns:
the minimum coordinate in the array

scroll

protected static void scroll(KaboumCoordinate[] coordinates,
                             KaboumCoordinate firstCoordinate)
Shifts the positions of the coordinates until firstCoordinate is first.

Parameters:
coordinates - the array to rearrange
firstCoordinate - the coordinate to make first

hasNullElements

protected static boolean hasNullElements(java.lang.Object[] array)
Returns true if the array contains any null elements.

Parameters:
array - an array to validate
Returns:
true if any of arrays elements are null

hasNonEmptyElements

protected static boolean hasNonEmptyElements(KaboumGeometry[] geometries)
Returns true if the array contains any non-empty Geometrys.

Parameters:
geometries - an array of Geometrys

indexOf

protected static int indexOf(KaboumCoordinate coordinate,
                             KaboumCoordinate[] coordinates)
Returns the index of coordinate in coordinates. The first position is 0; the second, 1; etc.

Parameters:
coordinate - the Coordinate to search for
coordinates - the array to search
Returns:
the position of coordinate, or -1 if it is not found

clone

public java.lang.Object clone()
Perform an exact copy of this object

Overrides:
clone in class java.lang.Object

getNumGeometries

public int getNumGeometries()
Return the number og geometries


removeGeometry

public boolean removeGeometry(KaboumGeometry inputGeometry)
Always returns false


getGeometryN

public KaboumGeometry getGeometryN(int n)
Return the number og geometries


addCoordinate

public void addCoordinate(KaboumCoordinate internal)

addCoordinateInGeometryN

public void addCoordinateInGeometryN(KaboumCoordinate internal,
                                     int i)

getCoordinates

public abstract KaboumCoordinate[] getCoordinates()
Returns this Geometry s vertices.

Returns:
the vertices of this Geometry

getExteriorCoordinates

public abstract KaboumCoordinate[] getExteriorCoordinates()
Returns this Geometry s exterior vertices.

Returns:
the vertices of this Geometry

setCoordinates

public abstract boolean setCoordinates(KaboumCoordinate[] internals)
Fill a SIMPLE geometry with input coordinates list

Returns:
the vertices of this Geometry

getNumPoints

public abstract int getNumPoints()
Returns the count of this Geometrys vertices.

Returns:
the number of vertices in this Geometry

getExteriorNumPoints

public abstract int getExteriorNumPoints()

isClosed

public abstract boolean isClosed()

getDimension

public abstract int getDimension()

getGeometryType

public abstract java.lang.String getGeometryType()

normalize

public abstract void normalize()

equalsExact

public abstract boolean equalsExact(KaboumGeometry other)

getExtent

public abstract KaboumExtent getExtent()

getArea

public abstract double getArea()

getPerimeter

public abstract double getPerimeter()

isEmpty

public abstract boolean isEmpty()


Copyright © 2005 Kaboum team. All Rights Reserved.