Statistics
| Revision:

root / branches / v2_0_0_prep / libraries / libFMap_geometries / src / org / gvsig / fmap / geom / type / GeometryType.java @ 38596

History | View | Annotate | Download (3.92 KB)

1 20761 jmvivo
package org.gvsig.fmap.geom.type;
2
3 26788 jpiera
import org.gvsig.fmap.geom.Geometry;
4 27397 jpiera
import org.gvsig.fmap.geom.exception.CreateGeometryException;
5 20761 jmvivo
import org.gvsig.fmap.geom.operation.GeometryOperation;
6
7 26788 jpiera
/**
8 26809 jpiera
 * This class represents the type of a geometry. All the geometries
9
 * has to have a type that can be retrieved using the
10
 * {@link Geometry}{@link #getGeometryType()} method.
11
 *
12 26788 jpiera
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
13
 */
14
public interface GeometryType {
15 20761 jmvivo
16 26809 jpiera
        /**
17
         * @return the name of the geometry type.
18
         */
19 26788 jpiera
        public String getName();
20 20761 jmvivo
21 26809 jpiera
        /**
22
         * @return the type of the geometry. It is a constant value
23
         * that has to be one of the values in {@link Geometry.TYPES}
24 26866 jpiera
         * The type is an abstract representation of the object (Point, Curve...)
25
         * but it is not a concrete representation (Point2D, Point3D...).
26 26809 jpiera
         */
27 26866 jpiera
        public int getType();
28 20761 jmvivo
29 26809 jpiera
        /**
30 26866 jpiera
         * @return the subtype of the geometry. It is a constant value
31
         * that has to be one of the values in {@link Geometry.SUBTYPES}.
32
         * The subtype represents a set of geometries with a
33
         * dimensional relationship (2D, 3D, 2DM...)
34
         */
35
        public int getSubType();
36
37
        /**
38 35185 jpiera
         * Check if a geometry type inherits of other type. E.g:
39
         * the super type of an arc could be a a curve, the super
40
         * type of a circle could be a surface...
41
         * @param geometryType
42
         * the value of the {@link Geometry.TYPES} to check if is
43
         * it super type
44
         * @return
45
         * <true> if the the parameter is a super type of this
46
         * geometry type
47
         */
48
        public boolean isTypeOf(int geometryType);
49
50
        /**
51
     * Check if a geometry subType inherits of other subType. E.g:
52
     * the super Subtype of a geometry 3D could be a geometry 2D,
53
     * because the 3D extends the behavior of a geometry 2D.
54
     * @param geometrySubType
55
     * the value of the {@link Geometry.SUBTYPES} to check if is
56
     * it super subType
57
     * @return
58
     * <true> if the the parameter is a super subType of this
59
     * geometry type
60
     */
61
        public boolean isSubTypeOf(int geometrySubType);
62 37323 cordinyana
63
    /**
64
     * Check if a geometry type inherits of other type. E.g:
65
     * the super type of an arc could be a a curve, the super
66
     * type of a circle could be a surface...
67
     *
68
     * @param geometryType
69
     *            the geometry type to check if is it super type
70
     * @return
71
     *         if the the parameter is a super type of this
72
     *         geometry type
73
     */
74
    public boolean isTypeOf(GeometryType geometryType);
75
76
    /**
77
     * Check if a geometry subType inherits of other subType. E.g:
78
     * the super Subtype of a geometry 3D could be a geometry 2D,
79
     * because the 3D extends the behavior of a geometry 2D.
80
     *
81
     * @param geometryType
82
     *            the geometry type to check if is it super subtype
83
     * @return
84
     *         if the the parameter is a super subType of this
85
     *         geometry type
86
     */
87
    public boolean isSubTypeOf(GeometryType geometryType);
88 35185 jpiera
89
        /**
90 26809 jpiera
         * This method creates a {@link Geometry} with the type specified
91
         * by this class. The geometry is empty, and all the internal
92
         * attributes must be assigned to a value when the geometry has
93
         * been created.
94
         *
95
         * @return
96
         * A empty geometry
97
         * @throws InstantiationException
98
         * This exception is maybe thrown when  the application is  trying
99
         * to instantiate the geometry
100
         * @throws IllegalAccessException
101
         * This exception is maybe thrown when  the application is  trying
102
         * to instantiate the geometry
103
         */
104 27397 jpiera
        public Geometry create() throws CreateGeometryException;
105 26788 jpiera
106 21007 jiyarza
        /**
107 26809 jpiera
         * Registers an operation for this geometry type.
108 20761 jmvivo
         * @param index
109
         * @param geomOp
110
         */
111 26788 jpiera
        public void setGeometryOperation(int index, GeometryOperation geomOp);
112 20761 jmvivo
113 26809 jpiera
        /**
114
         * Get the operation for this geometry at a concrete position
115
         * @param index
116
         * The position of the operation
117
         * @return
118
         * A geometry operation
119
         */
120 26788 jpiera
        public GeometryOperation getGeometryOperation(int index);
121 20761 jmvivo
122 26809 jpiera
        /**
123
         * @return the geometry as a String
124
         */
125 26788 jpiera
        public String toString();
126 20761 jmvivo
127
}