public class TLcdMIFModelDescriptor extends TLcdFeaturedModelDescriptor implements ILcdModelDescriptor,ILcdFeaturedDescriptor, ILcdClassContentDescriptor, ILcdDataModelDescriptor
This ILcdModelDescriptor can be used to describe model constructed from MapInfo Interchange Format data.
This class implements both the ILcdFeaturedDescriptor
and the ILcdDataModelDescriptor
interfaces. ILcdFeaturedDescriptor
is included for backwards compatibility, but it is recommended to use
the methods from the ILcdDataModelDescriptor
interface when possible.
In addition to the functionality described by these interfaces this descriptor contains the lists of geometry types and classes that are present in the model.
Modifier and Type | Field and Description |
---|---|
static short |
ARC
The identifier for the ARC type.
|
static short |
COLLECTION
The identifier for the COLLECTION type.
|
static short |
ELLIPSE
The identifier for the ELLIPSE type.
|
static short |
LINE
The identifier for the LINE type.
|
static short |
MULTIPOINT
The identifier for the MULTIPOINT type.
|
static short |
PLINE
The identifier for the PLINE type.
|
static short |
POINT
The identifier for the POINT type.
|
static short |
RECT
The identifier for the RECT type.
|
static short |
REGION
The identifier for the REGION type.
|
static short |
ROUNDRECT
The identifier for the ROUNDRECT type.
|
static short |
TEXT
The identifier for the TEXT type.
|
static String |
TYPE_NAME
The model type, "MIF".
|
fFeatureClasses, fFeatureNames
Constructor and Description |
---|
TLcdMIFModelDescriptor(String aSourceName,
String aDisplayName,
short[] aMIFGeometryTypes,
String[] aFeatureNames)
|
TLcdMIFModelDescriptor(String aSourceName,
String aDisplayName,
short[] aMIFGeometryTypes,
String[] aFeatureNames,
Class[] aFeatureClasses)
|
TLcdMIFModelDescriptor(String aSourceName,
String aDisplayName,
short[] aMIFGeometryTypes,
TLcdDataType aDataType)
Constructs a descriptor for a model containing MapInfo Interchange Format data.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contentContainsClass(Class aClass)
Returns whether at least one object in the container is an instance of the given class.
|
Class |
getContentClass(int aIndex)
Returns the content class at index aIndex in the object container..
|
int |
getContentClassCount()
Returns the number of distinct Classes contained in an object container..
|
TLcdDataModel |
getDataModel()
Returns the data model that describes the elements of the model.
|
short[] |
getMIFGeometryTypes()
Returns the property MIFGeometryTypes.
|
Set<TLcdDataType> |
getModelElementTypes()
Returns a set containing all the data types of which instances can be elements in the model
associated with this descriptor.
|
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.
|
short[] |
getShapeType()
Deprecated.
|
short[] |
getShapeTypes()
Deprecated.
|
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 short POINT
public static final short LINE
public static final short PLINE
public static final short REGION
public static final short ARC
public static final short TEXT
public static final short RECT
public static final short ROUNDRECT
public static final short ELLIPSE
public static final short MULTIPOINT
public static final short COLLECTION
@Deprecated public TLcdMIFModelDescriptor(String aSourceName, String aDisplayName, short[] aMIFGeometryTypes, String[] aFeatureNames)
aSourceName
- identifies the source of the models data.aDisplayName
- the display name of the model.aMIFGeometryTypes
- an array of shorts representing the geometries present in the source.aFeatureNames
- an array with the names of the features the data holds.@Deprecated public TLcdMIFModelDescriptor(String aSourceName, String aDisplayName, short[] aMIFGeometryTypes, String[] aFeatureNames, Class[] aFeatureClasses)
aSourceName
- identifies the source of the models data.aDisplayName
- the display name of the model.aMIFGeometryTypes
- an array of shorts representing the geometries present in the source.aFeatureNames
- an array with the names of the features the data holds.aFeatureClasses
- an array with the classes of the features.public TLcdMIFModelDescriptor(String aSourceName, String aDisplayName, short[] aMIFGeometryTypes, TLcdDataType aDataType)
aSourceName
- identifies the source of the models data.aDisplayName
- the display name of the model.aMIFGeometryTypes
- an array of shorts representing the geometries present in the
source.aDataType
- the data model of the model descriptorpublic short[] getShapeType()
getMIFGeometryTypes()
.public short[] getShapeTypes()
getMIFGeometryTypes()
.
public short[] getMIFGeometryTypes()
public int getContentClassCount()
ILcdContentDescriptor
getContentClassCount
in interface ILcdContentDescriptor
public Class getContentClass(int aIndex)
ILcdContentDescriptor
getContentClass
in interface ILcdContentDescriptor
aIndex
- the number of the content class.public boolean contentContainsClass(Class aClass)
ILcdClassContentDescriptor
contentContainsClass
in interface ILcdClassContentDescriptor
aClass
- the class to check.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()
ILcdDataModelDescriptor
Returns a set containing all the data types of which instances can be elements in the model associated with this descriptor. Implementations are free to limit the result to only include the types of which there are actually elements in the model; but they are not required to do so.
Implementations should return null
in case they don't know
which element types are present in the model.
For each element of the model associated with this model descriptor, the following holds true :
getModelElementTypes().contains( element.getDataType() )
.
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