public class TLcdDWGModelDescriptor extends TLcdModelDescriptor implements ILcdDataModelDescriptor, ILcdClassContentDescriptor
ILcdModelDescriptor
to describe data in
AutoCAD format (with the extension DWG
).Constructor and Description |
---|
TLcdDWGModelDescriptor(String aSourceName,
String aDisplayName,
TLcdDWGLayer[] aDWGLayers,
TLcdDWGLineType[] aDWGLineTypes)
Creates a new TLcdDWGModelDescriptor with the given properties and a generic data model.
|
TLcdDWGModelDescriptor(String aSourceName,
TLcdDWGLayer[] aDWGLayers,
TLcdDWGLineType[] aDWGLineTypes)
Creates a new TLcdDWGModelDescriptor with the given properties and a generic data model.
|
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.
|
TLcdDWGLayer |
getDWGLayer(int aIndex) |
int |
getDWGLayerCount() |
TLcdDWGLineType |
getDWGLineType(int aIndex) |
int |
getDWGLineTypeCount() |
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.
|
getDisplayName, getSourceName, getTypeName, setDisplayName, setSourceName, setTypeName, sourceNameToDisplayName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDisplayName, getSourceName, getTypeName
public TLcdDWGModelDescriptor(String aSourceName, TLcdDWGLayer[] aDWGLayers, TLcdDWGLineType[] aDWGLineTypes)
public TLcdDWGModelDescriptor(String aSourceName, String aDisplayName, TLcdDWGLayer[] aDWGLayers, TLcdDWGLineType[] aDWGLineTypes)
public int getDWGLayerCount()
public TLcdDWGLayer getDWGLayer(int aIndex)
aIndex
- a valid index of layer.public int getDWGLineTypeCount()
public TLcdDWGLineType getDWGLineType(int aIndex)
aIndex
- a valid index of line type.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
TLcdDWGDataTypes
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
TLcdDWGDataTypes
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