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

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

public class DefaultGeometryType
extends AbstractGeometryType

Author:
Jorge Piera

Constructor Summary
DefaultGeometryType(Class geomClass, String name, int type, int subType)
          This constructor is used by the GeometryManager when it register a new GeometryType.
DefaultGeometryType(Class geomClass, String name, 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.
 Class getGeometryClass()
           
 String getName()
           
 int getSubType()
           
 int getType()
           
 boolean isSubTypeOf(int geometrySubType)
          Check if a geometry subType inherits of other subType.
 boolean isTypeOf(int geometryType)
          Check if a geometry type inherits of other type.
 
Methods inherited from class org.gvsig.fmap.geom.type.AbstractGeometryType
equals, getGeometryOperation, getGeometryOperations, isSubTypeOf, isTypeOf, setGeometryOperation, 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 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 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.

Returns:
A new geometry
Throws:
CreateGeometryException

getGeometryClass

public Class getGeometryClass()

getName

public String getName()
Returns:
the name of the geometry type.

getType

public int getType()
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()
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...

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.

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


Copyright © 2004-2013 gvSIG. All Rights Reserved.