Class TLcdHashedFeaturedModelDescriptor

java.lang.Object
com.luciad.model.TLcdModelDescriptor
com.luciad.ais.model.TLcdHashedFeaturedModelDescriptor
All Implemented Interfaces:
ILcdDataModelDescriptor, ILcdModelDescriptor, ILcdFeaturedDescriptor, Serializable
Direct Known Subclasses:
TLcdAerodromeModelDescriptor, TLcdAirspaceModelDescriptor, TLcdATSRouteModelDescriptor, TLcdDMEModelDescriptor, TLcdGeoborderModelDescriptor, TLcdGlidePathModelDescriptor, TLcdHelipadModelDescriptor, TLcdHeliportModelDescriptor, TLcdHoldingModelDescriptor, TLcdILSDMEModelDescriptor, TLcdILSModelDescriptor, TLcdLocalizerModelDescriptor, TLcdMarkerModelDescriptor, TLcdMilitaryTrainingRouteModelDescriptor, TLcdNDBModelDescriptor, TLcdObstacleModelDescriptor, TLcdOrtcaModelDescriptor, TLcdParachuteJumpAreaModelDescriptor, TLcdProcedureModelDescriptor, TLcdProcedureTrajectoryModelDescriptor, TLcdRefuelingAirspaceModelDescriptor, TLcdRefuelingTrackModelDescriptor, TLcdRunwayModelDescriptor, TLcdServiceModelDescriptor, TLcdSpecialUseAirspaceModelDescriptor, TLcdTACANModelDescriptor, TLcdVFRAerodromeModelDescriptor, TLcdVFROffsetModelDescriptor, TLcdVFRRouteModelDescriptor, TLcdVORModelDescriptor, TLcdWayPointModelDescriptor

public class TLcdHashedFeaturedModelDescriptor extends TLcdModelDescriptor implements ILcdFeaturedDescriptor, ILcdDataModelDescriptor
This class provides an implementation of ILcdModelDescriptor that is also an ILcdFeaturedDescriptor. It has a list of feature names, along with their corresponding classes. Internally, a hashtable is used to provide an efficient mapping from feature names to feature indices.

All elements of the corresponding model shall be ILcdFeatured and shall have the same features.

Note that this model descriptor is a specific implementation to be used in the context of AIS. It is not a general purpose implementation that can be used to create a featured descriptor given a data type.

See Also:
  • Constructor Details

    • TLcdHashedFeaturedModelDescriptor

      @Deprecated public TLcdHashedFeaturedModelDescriptor(String aSourceName, String aTypeName, String aDisplayName, String[] aFeatureNames, Class[] aFeatureClasses)
      Constructs a new TLcdHashedFeaturedModelDescriptor object.
      Parameters:
      aSourceName - the name of the data source
      aTypeName - the type name of the data source
      aDisplayName - the display name of the data source
      aFeatureNames - the feature names
      aFeatureClasses - the feature classes
    • TLcdHashedFeaturedModelDescriptor

      @Deprecated public TLcdHashedFeaturedModelDescriptor(String aSourceName, String aTypeName, String aDisplayName, ILcdFeaturedDescriptor aModelDescriptor)
      Constructs a new TLcdHashedFeaturedModelDescriptor object. This constructor is used to reuse an existing model descriptor, but change the source, type and display name.
      Parameters:
      aSourceName -
      aTypeName -
      aDisplayName -
      aModelDescriptor -
    • TLcdHashedFeaturedModelDescriptor

      public TLcdHashedFeaturedModelDescriptor(String aSourceName, String aTypeName, String aDisplayName, TLcdDataType aElementType)
      Constructs a new TLcdHashedFeaturedModelDescriptor object. The aElementType parameter will be used to determine the names and classes of the features of the model elements.
      Parameters:
      aSourceName - the name of the data source
      aTypeName - the type name of the data source
      aDisplayName - the display name of the data source
      aElementType - the data type of the elements that will be contained in the model that uses this descriptor.
  • Method Details

    • getDataModel

      public TLcdDataModel getDataModel()

      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 interface ILcdDataModelDescriptor
      Returns:
      the data model that describes the elements of the model
    • getModelElementTypes

      public Set<TLcdDataType> getModelElementTypes()
      Returns a singleton set that contains the type with which this object was created. In case the object was created using one of the deprecated constructors that don't take a type parameter, the TLcdUnknownDataTypes.UNKOWN_TYPE is returned.
      Specified by:
      getModelElementTypes in interface ILcdDataModelDescriptor
      Returns:
      a set containing the single model element type of this model descriptor
    • getModelTypes

      public 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. 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 interface ILcdDataModelDescriptor
      Returns:
      a set containing all the data types of which instances can be used in the model associated with this descriptor
    • getFeatureCount

      public int getFeatureCount()
      Description copied from interface: ILcdFeaturedDescriptor
      Returns the number of features.
      Specified by:
      getFeatureCount in interface ILcdFeaturedDescriptor
      Returns:
      the number of features.
    • getFeatureName

      public String getFeatureName(int aIndex)
      Description copied from interface: ILcdFeaturedDescriptor
      Returns the name of the feature at the given index.
      Specified by:
      getFeatureName in interface ILcdFeaturedDescriptor
      Parameters:
      aIndex - a valid feature index.
      Returns:
      the name of the feature at the given index.
    • getFeatureIndex

      public int getFeatureIndex(String aName)
      Description copied from interface: ILcdFeaturedDescriptor
      Returns the index of the given feature name if it exists, -1 otherwise.
      Specified by:
      getFeatureIndex in interface ILcdFeaturedDescriptor
      Parameters:
      aName - a feature name.
      Returns:
      the index of the given feature name if it exists, -1 otherwise.
    • getFeatureClass

      public Class getFeatureClass(int aIndex)
      Description copied from interface: ILcdFeaturedDescriptor
      Returns the Class of the feature at the given index.
      Specified by:
      getFeatureClass in interface ILcdFeaturedDescriptor
      Parameters:
      aIndex - a valid feature index.
      Returns:
      the Class of the feature at the given index.