public class TLcdSHPModelDescriptor extends TLcdFeaturedModelDescriptor implements ILcdModelDescriptor,ILcdFeaturedDescriptor, ILcdClassContentDescriptor, ILcdDataModelDescriptor
ILcdModelDescriptor
, ILcdFeaturedDescriptor
and
ILcdClassContentDescriptor
implementation for models containing ESRI shape data decoded with the
TLcdSHPModelDecoder
.
On top of the functionality described by these interfaces this descriptor contains the list of geometries present in
the model. The list is accessible through the property ShapeTypes as an array of integers which are
defined in this class.TLcdSHPModelDecoder
,
Serialized FormModifier and Type | Field and Description |
---|---|
static int |
MULTI_POINT
Indicates a multi-point whose points exists of (x,y) values.
|
static int |
MULTI_POINT_M
Indicates a multi-point whose points exists of (x,y) values and a measure value for each point.
|
static int |
MULTI_POINT_Z
Indicates a multi-point whose points exists of (x,y,z) values and a measure value for each point.
|
static int |
NULL_SHAPE
Indicates a empty ESRI shape.
|
static int |
POINT
Indicates a point with a (x,y) coordinate.
|
static int |
POINT_M
Indicates a point with a (x,y) coordinate and a measure value.
|
static int |
POINT_Z
Indicates a point with a (x,y,z) coordinate and a measure value.
|
static int |
POLYGON
Indicates a multi-polygon whose points exists of (x,y) values.
|
static int |
POLYGON_M
Indicates a multi-polygon whose points exists of (x,y) values and a measure value for each point.
|
static int |
POLYGON_Z
Indicates a multi-polygon whose points exists of (x,y,z) values and a measure value for each point.
|
static int |
POLYLINE
Indicates a multi-polyline whose points exists of (x,y) values.
|
static int |
POLYLINE_M
Indicates a multi-polyline whose points exists of (x,y) values and a measure value for each point.
|
static int |
POLYLINE_Z
Indicates a multi-polyline whose points exists of (x,y,z) values and a measure value for each point.
|
static String |
TYPE_NAME
The name for ESRI SHP format data.
|
static int |
UNKNOWN_SHAPE
Indicates an unknown ESRI shape.
|
fFeatureClasses, fFeatureNames
Constructor and Description |
---|
TLcdSHPModelDescriptor(String aSourceName,
String aDisplayName,
int[] aShapeTypes,
String[] aFeatureNames,
Class[] aFeatureClasses)
Constructs a model descriptor for models containing ESRI SHP data.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contentContainsClass(Class aClass)
Returns whether the model contains an object of exactly the given class.
|
Class |
getContentClass(int aIndex)
Returns the class at the given index.
|
int |
getContentClassCount()
Returns the number of distinct classes of objects in the model.
|
TLcdDataModel |
getDataModel()
Returns the data model that describes the elements of the model.
|
Set<TLcdDataType> |
getModelElementTypes()
Returns a set containing the single type of which all model elements are instances.
|
Set<TLcdDataType> |
getModelTypes()
Returns a set containing all the types of which instances can be used (including both
top-level elements and child objects) in the model associated with this descriptor.
|
int[] |
getShapeTypes()
Returns the list geometries that occur in the model.
|
getFeatureClass, getFeatureCount, getFeaturedDescriptor, getFeatureIndex, getFeatureName
getDisplayName, getSourceName, getTypeName, setDisplayName, setSourceName, setTypeName, sourceNameToDisplayName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFeatureClass, getFeatureCount, getFeatureIndex, getFeatureName, getFeatureUnitOfMeasure
getDisplayName, getSourceName, getTypeName
public static final String TYPE_NAME
public static final int UNKNOWN_SHAPE
public static final int NULL_SHAPE
public static final int POINT
public static final int POLYLINE
public static final int POLYGON
public static final int MULTI_POINT
public static final int POINT_Z
public static final int POLYLINE_Z
public static final int POLYGON_Z
public static final int MULTI_POINT_Z
public static final int POINT_M
public static final int POLYLINE_M
public static final int POLYGON_M
public static final int MULTI_POINT_M
public TLcdSHPModelDescriptor(String aSourceName, String aDisplayName, int[] aShapeTypes, String[] aFeatureNames, Class[] aFeatureClasses)
aSourceName
- identifies the source name of the model.aDisplayName
- a display name for the model.aShapeTypes
- the ESRI geometries in the model.aFeatureNames
- the names of the features of the objects in the model.aFeatureClasses
- the classes of the features of the objects in the model.public int[] getShapeTypes()
public int getContentClassCount()
getContentClassCount
in interface ILcdContentDescriptor
public Class getContentClass(int aIndex)
getContentClass
in interface ILcdContentDescriptor
aIndex
- the index for which the class is requested. This index should be smaller than the
return value of getContentClassCount()
.public boolean contentContainsClass(Class aClass)
contentContainsClass
in interface ILcdClassContentDescriptor
aClass
- the class to check for.public TLcdDataModel getDataModel()
ILcdDataModelDescriptor
Returns the data model that describes the elements of the model. Note that not necessarily all data in the model will be of a type of this data model. Very likely, types from the dependencies of the returned data model are used as well.
In case the model accepts objects from multiple data models, an anonymous
data model that depends on all these data models should be returned
(see TLcdDataModelBuilder.createAnonymousDataModel(java.util.Collection)
).
getDataModel
in interface ILcdDataModelDescriptor
public Set<TLcdDataType> getModelElementTypes()
getModelElementTypes
in interface ILcdDataModelDescriptor
public Set<TLcdDataType> getModelTypes()
ILcdDataModelDescriptor
Returns a set containing all the types of which instances can be used (including both top-level elements and child objects) in the model associated with this descriptor. Implementations are free to limit the result to only include the types of which there are actually instances in the model; but they are not required to do so.
A simple and correct implementation would be to return
getDataModel().getTypes()
. Implementations are encouraged to return a subset of
this set if they can do so without spending an unreasonable amount of resources.
Implementations should return null
in case they don't know
which types are present in the model.
getModelTypes
in interface ILcdDataModelDescriptor