org.gvsig.fmap.geom.type.impl
Class DefaultGeometryType

java.lang.Object
  extended by org.gvsig.fmap.geom.type.impl.DefaultGeometryType
All Implemented Interfaces:
GeometryType

public class DefaultGeometryType
extends Object
implements GeometryType

Author:
Jorge Piera

Constructor Summary
DefaultGeometryType(Class geomClass, String name, int id, int type, int subType)
          This constructor is used by the GeometryManager when it register a new GeometryType.
DefaultGeometryType(Class geomClass, String name, int id, int type, int subType, int[] superTypes, int[] superSubTypes)
          This constructor is used by the GeometryManager when it register a new GeometryType.
 
Method Summary
 Geometry create()
          This method creates a Geometry with the type specified by this GeometryType.
 boolean equals(Object obj)
           
 Class getGeometryClass()
           
 GeometryOperation getGeometryOperation(int index)
          Get the operation for this geometry at a concrete position
 int getId()
           
 String getName()
           
 int getSubType()
           
 int getType()
           
 boolean isSubTypeOf(GeometryType geometryType)
          Check if a geometry subType inherits of other subType.
 boolean isSubTypeOf(int geometrySubType)
          Check if a geometry subType inherits of other subType.
 boolean isTypeOf(GeometryType geometryType)
          Check if a geometry type inherits of other type.
 boolean isTypeOf(int geometryType)
          Check if a geometry type inherits of other type.
 void setGeometryOperation(int index, GeometryOperation geomOp)
          Guardamos una referencia a una instancia de la operación en el índice que se pasa como parámetro.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultGeometryType

public DefaultGeometryType(Class geomClass,
                           String name,
                           int id,
                           int type,
                           int subType,
                           int[] superTypes,
                           int[] superSubTypes)
This constructor is used by the GeometryManager when it register a new GeometryType. It has not be used from other parts.

Parameters:
geomClass - Geometry class (e.g: Point2D.class)
name - Symbolic Geometry name that is used to persist the geometry type. In some cases, it is better to use this name because the id can change for different application executions.
id - Geometry id
typeName - The geometry type name
type - The geometry abstract type
superTypes - The superTypes of the geometry type
superSubTypes - The superSubtypes of the geometry type

DefaultGeometryType

public DefaultGeometryType(Class geomClass,
                           String name,
                           int id,
                           int type,
                           int subType)
This constructor is used by the GeometryManager when it register a new GeometryType. It has not be used from other parts.

Parameters:
geomClass - Geometry class (e.g: Point2D.class)
name - Symbolic Geometry name that is used to persist the geometry type. In some cases, it is better to use this name because the id can change for different application executions.
id - Geometry id
typeName - The geometry type name
type - The geometry abstract type
Method Detail

create

public Geometry create()
                throws CreateGeometryException
This method creates a Geometry with the type specified by this GeometryType. The geometry has to have a constructor without arguments.

Specified by:
create in interface GeometryType
Returns:
A new geometry
Throws:
CreateGeometryException

setGeometryOperation

public void setGeometryOperation(int index,
                                 GeometryOperation geomOp)
Guardamos una referencia a una instancia de la operación en el índice que se pasa como parámetro. Si el índice ya está ocupado se sobrescribe.

Specified by:
setGeometryOperation in interface GeometryType
Parameters:
index -
geomOp -

getGeometryOperation

public GeometryOperation getGeometryOperation(int index)
Description copied from interface: GeometryType
Get the operation for this geometry at a concrete position

Specified by:
getGeometryOperation in interface GeometryType
Parameters:
index - The position of the operation
Returns:
A geometry operation

getGeometryClass

public Class getGeometryClass()

toString

public String toString()
Specified by:
toString in interface GeometryType
Overrides:
toString in class Object
Returns:
the geometry as a String

getId

public int getId()
Specified by:
getId in interface GeometryType
Returns:
the identifier of the geometry type. This identifier is assigned by the GeometryManager in run time.

getName

public String getName()
Specified by:
getName in interface GeometryType
Returns:
the name of the geometry type.

getType

public int getType()
Specified by:
getType in interface GeometryType
Returns:
the type of the geometry. It is a constant value that has to be one of the values in Geometry.TYPES The type is an abstract representation of the object (Point, Curve...) but it is not a concrete representation (Point2D, Point3D...).

getSubType

public int getSubType()
Specified by:
getSubType in interface GeometryType
Returns:
the subtype of the geometry. It is a constant value that has to be one of the values in Geometry.SUBTYPES. The subtype represents a set of geometries with a dimensional relationship (2D, 3D, 2DM...)

isTypeOf

public boolean isTypeOf(int geometryType)
Description copied from interface: GeometryType
Check if a geometry type inherits of other type. E.g: the super type of an arc could be a a curve, the super type of a circle could be a surface...

Specified by:
isTypeOf in interface GeometryType
Parameters:
geometryType - the value of the Geometry.TYPES to check if is it super type
Returns:
if the the parameter is a super type of this geometry type

isSubTypeOf

public boolean isSubTypeOf(int geometrySubType)
Description copied from interface: GeometryType
Check if a geometry subType inherits of other subType. E.g: the super Subtype of a geometry 3D could be a geometry 2D, because the 3D extends the behavior of a geometry 2D.

Specified by:
isSubTypeOf in interface GeometryType
Parameters:
geometrySubType - the value of the Geometry.SUBTYPES to check if is it super subType
Returns:
if the the parameter is a super subType of this geometry type

isTypeOf

public boolean isTypeOf(GeometryType geometryType)
Description copied from interface: GeometryType
Check if a geometry type inherits of other type. E.g: the super type of an arc could be a a curve, the super type of a circle could be a surface...

Specified by:
isTypeOf in interface GeometryType
Parameters:
geometryType - the geometry type to check if is it super type
Returns:
if the the parameter is a super type of this geometry type

isSubTypeOf

public boolean isSubTypeOf(GeometryType geometryType)
Description copied from interface: GeometryType
Check if a geometry subType inherits of other subType. E.g: the super Subtype of a geometry 3D could be a geometry 2D, because the 3D extends the behavior of a geometry 2D.

Specified by:
isSubTypeOf in interface GeometryType
Parameters:
geometryType - the geometry type to check if is it super subtype
Returns:
if the the parameter is a super subType of this geometry type

equals

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


Copyright © 2004-2012 gvSIG. All Rights Reserved.