Class TLcdSHPModelDescriptor

All Implemented Interfaces:
ILcdDataModelDescriptor, ILcdModelDescriptor, ILcdClassContentDescriptor, ILcdContentDescriptor, ILcdFeaturedDescriptor, ILcdFeaturedDescriptorProvider, Serializable

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.
See Also:
  • Field Details

    • TYPE_NAME

      public static final String TYPE_NAME
      The name for ESRI SHP format data.
      See Also:
    • UNKNOWN_SHAPE

      public static final int UNKNOWN_SHAPE
      Indicates an unknown ESRI shape.
      See Also:
    • NULL_SHAPE

      public static final int NULL_SHAPE
      Indicates a empty ESRI shape.
      See Also:
    • POINT

      public static final int POINT
      Indicates a point with a (x,y) coordinate.
      See Also:
    • POLYLINE

      public static final int POLYLINE
      Indicates a multi-polyline whose points exists of (x,y) values.
      See Also:
    • POLYGON

      public static final int POLYGON
      Indicates a multi-polygon whose points exists of (x,y) values.
      See Also:
    • MULTI_POINT

      public static final int MULTI_POINT
      Indicates a multi-point whose points exists of (x,y) values.
      See Also:
    • POINT_Z

      public static final int POINT_Z
      Indicates a point with a (x,y,z) coordinate and a measure value.
      See Also:
    • POLYLINE_Z

      public static final int POLYLINE_Z
      Indicates a multi-polyline whose points exists of (x,y,z) values and a measure value for each point.
      See Also:
    • POLYGON_Z

      public static final int POLYGON_Z
      Indicates a multi-polygon whose points exists of (x,y,z) values and a measure value for each point.
      See Also:
    • MULTI_POINT_Z

      public static final int MULTI_POINT_Z
      Indicates a multi-point whose points exists of (x,y,z) values and a measure value for each point.
      See Also:
    • POINT_M

      public static final int POINT_M
      Indicates a point with a (x,y) coordinate and a measure value.
      See Also:
    • POLYLINE_M

      public static final int POLYLINE_M
      Indicates a multi-polyline whose points exists of (x,y) values and a measure value for each point.
      See Also:
    • POLYGON_M

      public static final int POLYGON_M
      Indicates a multi-polygon whose points exists of (x,y) values and a measure value for each point.
      See Also:
    • MULTI_POINT_M

      public static final int MULTI_POINT_M
      Indicates a multi-point whose points exists of (x,y) values and a measure value for each point.
      See Also:
  • Constructor Details

    • TLcdSHPModelDescriptor

      public TLcdSHPModelDescriptor(String aSourceName, String aDisplayName, int[] aShapeTypes, String[] aFeatureNames, Class[] aFeatureClasses)
      Constructs a model descriptor for models containing ESRI SHP data.
      Parameters:
      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.
  • Method Details

    • getShapeTypes

      public int[] getShapeTypes()
      Returns the list geometries that occur in the model.
      Returns:
      an array of integers that represents the geometries present in the source data.
    • getContentClassCount

      public int getContentClassCount()
      Returns the number of distinct classes of objects in the model. 0 if not defined yet.
      Specified by:
      getContentClassCount in interface ILcdContentDescriptor
      Returns:
      the number of distinct classes of objects in the model. 0 if not defined yet.
    • getContentClass

      public Class getContentClass(int aIndex)
      Returns the class at the given index.
      Specified by:
      getContentClass in interface ILcdContentDescriptor
      Parameters:
      aIndex - the index for which the class is requested. This index should be smaller than the return value of getContentClassCount().
      Returns:
      the class at the given index.
    • contentContainsClass

      public boolean contentContainsClass(Class aClass)
      Returns whether the model contains an object of exactly the given class.
      Specified by:
      contentContainsClass in interface ILcdClassContentDescriptor
      Parameters:
      aClass - the class to check for.
      Returns:
      true when the model contains an object of exactly that class, false otherwise.
    • getDataModel

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

      public Set<TLcdDataType> getModelElementTypes()
      Returns a set containing the single type of which all model elements are instances.
      Specified by:
      getModelElementTypes in interface ILcdDataModelDescriptor
      Returns:
      a set containing the single type of which all model elements are instances
    • getModelTypes

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