Revision 37323

View differences:

branches/v2_0_0_prep/libraries/libFMap_geometries/src/org/gvsig/fmap/geom/type/GeometryType.java
66 66
     * geometry type
67 67
     */
68 68
	public boolean isSubTypeOf(int geometrySubType);
69

  
70
    /**
71
     * Check if a geometry type inherits of other type. E.g:
72
     * the super type of an arc could be a a curve, the super
73
     * type of a circle could be a surface...
74
     * 
75
     * @param geometryType
76
     *            the geometry type to check if is it super type
77
     * @return
78
     *         if the the parameter is a super type of this
79
     *         geometry type
80
     */
81
    public boolean isTypeOf(GeometryType geometryType);
82

  
83
    /**
84
     * Check if a geometry subType inherits of other subType. E.g:
85
     * the super Subtype of a geometry 3D could be a geometry 2D,
86
     * because the 3D extends the behavior of a geometry 2D.
87
     * 
88
     * @param geometryType
89
     *            the geometry type to check if is it super subtype
90
     * @return
91
     *         if the the parameter is a super subType of this
92
     *         geometry type
93
     */
94
    public boolean isSubTypeOf(GeometryType geometryType);
69 95
	
70 96
	/**
71 97
	 * This method creates a {@link Geometry} with the type specified 
branches/v2_0_0_prep/libraries/libFMap_geometries/src/org/gvsig/fmap/geom/type/impl/DefaultGeometryType.java
227 227
                return true;
228 228
            }
229 229
        }
230
        return false;
230
        return Geometry.TYPES.GEOMETRY == geometryType;
231 231
    }
232 232

  
233 233
    public boolean isSubTypeOf(int geometrySubType) {
......
241 241
        }
242 242
        return false;
243 243
    }
244

  
245
    public boolean isTypeOf(GeometryType geometryType) {
246
        return isTypeOf(geometryType.getType());
247
    }
248

  
249
    public boolean isSubTypeOf(GeometryType geometryType) {
250
        return isSubTypeOf(geometryType.getSubType());
251
    }
252

  
253
    public boolean equals(Object obj) {
254
        if (obj instanceof GeometryType) {
255
            GeometryType other = (GeometryType) obj;
256
            return type == other.getType() && subType == other.getSubType();
257
        }
258
        return false;
259
    }
244 260
}
245 261

  

Also available in: Unified diff