Class TLcdCGMModelDescriptor
- All Implemented Interfaces:
ILcdDataModelDescriptor
,ILcdModelDescriptor
,Serializable
This model descriptor is used to identify CGM models
.The CGM model descriptor implements ILcdDataModelDescriptor
. The data types
for this model can be found in the TLcdCGMDataTypes
class. Each CGM model can include
model elements of more than a single type. For this reason, the model elements can be set at
construction. Usually, the
model decoder will take care of identifying the types inside a model. If the model is updated
to feature more model element data types, a new model descriptor will have to be added with
an updated list of model element data types.
- See Also:
-
Constructor Summary
ConstructorDescriptionTLcdCGMModelDescriptor
(String aSourceName, String aDisplayName, String aTypeName) Creates aTLcdCGMModelDescriptor
without any known model element data types.TLcdCGMModelDescriptor
(String aSourceName, String aDisplayName, String aTypeName, Set<TLcdDataType> aModelElementTypes) Creates aTLcdCGMModelDescriptor
with a list of known model element data types. -
Method Summary
Modifier and TypeMethodDescriptionReturns the data model that describes the elements of the model.Returns a set containing all the data types of which instances can be elements in the model associated with this descriptor.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.Methods inherited from class com.luciad.model.TLcdModelDescriptor
getDisplayName, getSourceName, getTypeName, setDisplayName, setSourceName, setTypeName, sourceNameToDisplayName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.model.ILcdModelDescriptor
getDisplayName, getSourceName, getTypeName
-
Constructor Details
-
TLcdCGMModelDescriptor
Creates aTLcdCGMModelDescriptor
without any known model element data types. Using this constructor, a call togetModelElementTypes()
will returnTLcdCGMDataTypes.AbstractCGMType
. The data model of this model descriptor is the one defined inTLcdCGMDataTypes
.- Parameters:
aSourceName
- A source name of the CGM fileaDisplayName
- The display name of the modelaTypeName
- The type name of the model
-
TLcdCGMModelDescriptor
public TLcdCGMModelDescriptor(String aSourceName, String aDisplayName, String aTypeName, Set<TLcdDataType> aModelElementTypes) Creates aTLcdCGMModelDescriptor
with a list of known model element data types. A call togetModelElementTypes()
will return the given set of data types. The data model of this model descriptor is the one defined inTLcdCGMDataTypes
.- Parameters:
aSourceName
- A source name of the CGM fileaDisplayName
- The display name of the modelaTypeName
- The type name of the modelaModelElementTypes
- A list of model element data types used by this model. This is a list of any of the data types found in theTLcdCGMDataTypes
class.
-
-
Method Details
-
getDataModel
Description copied from interface: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)
).- Specified by:
getDataModel
in interfaceILcdDataModelDescriptor
- Returns:
- the data model that describes the elements of the model
-
getModelElementTypes
Description copied from interface: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() )
.- Specified by:
getModelElementTypes
in interfaceILcdDataModelDescriptor
- Returns:
- a set containing all the data types of which instances can be elements in the model associated with this descriptor
-
getModelTypes
Description copied from interface: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.- Specified by:
getModelTypes
in interfaceILcdDataModelDescriptor
- Returns:
- a set containing all the data types of which instances can be used in the model associated with this descriptor
-