Interface ILcdFeatureIndexedModel

All Superinterfaces:
AutoCloseable, ILcdDisposable, ILcdModel, Serializable
All Known Subinterfaces:
ILcdFeatureIndexedAnd2DBoundsIndexedModel
All Known Implementing Classes:
TLcdFeatureIndexedAnd2DBoundsIndexedModel, TLcdFeatureIndexedVectorModel

@Deprecated public interface ILcdFeatureIndexedModel extends ILcdModel
Deprecated.
The ILcdFeatured interface has been deprecated in favor of ILcdDataObject and TLcdDataModel.
An ILcdModel whose elements can be retrieved via a feature value-based index.

First an index on a certain set of features must be created in order to have efficient access to the model elements using these features. After adding an index, elements can be retrieved using a set of values for the features specified in the index.

Two types of indices are supported:

  • unique indices: each combination of feature values in the index is unique.
  • non-unique indices: a combination of feature values can exist more than once in the index.
Unique indices are more performant and should be preferred whenever possible. However, if a unique index is created while there are non-unique feature value combinations, only one element per unique combination is stored in the index.

Implementations should specify how they access the features of their elements (for example, via the ILcdFeatured interface) and which additional constraints they impose on the model (for example, have a model descriptor that implements ILcdFeaturedModelDescriptor).

Since:
6.0
  • Method Details

    • addIndex

      void addIndex(List aFeatureNames, boolean aUniqueIndex)
      Deprecated.
      Creates an index based on a set of feature names. All elements already contained in the model will be added to the new index; elements which are added after the index has been created, will be added automatically to all indices that have been created already.

      Note that each index consumes memory and it is advisable to keep the number of indices to a minimum. When an index is added that exists already (same names, same order), no new index is created.

      Parameters:
      aFeatureNames - the List of feature names defining the index to be created.
      aUniqueIndex - a boolean indicating whether the features used in this index form a unique key for the model elements (this means that for each element the set of feature values for aFeatureNames is unique in the model). If a unique index is created on a non-unique feature, only one element per feature value is stored in the index.
      Throws:
      NullPointerException - if aFeatureNames or one of its elements is null.}.
    • retrieveByIndex

      Vector retrieveByIndex(List aFeatureNames, List aFeatureValues)
      Deprecated.
      Returns a Vector containing all the model elements that have aFeatureValues as value for the index defined by aFeatureNames.

      Can return null if there is no match.

      Parameters:
      aFeatureNames - a List of feature names defining the index to be used.
      aFeatureValues - a List of feature values that should match with the values of the elements to be retrieved.
      Returns:
      a Vector with zero or more matching elements, or null if there is no match
      Throws:
      IllegalArgumentException - if no index was added for aFeatureNames.
      NullPointerException - if aFeatureNames == null || aFeatureValues == null or one of the feature names is null.
    • retrieveByUniqueIndex

      Object retrieveByUniqueIndex(List aFeatureNames, List aFeatureValues)
      Deprecated.
      Returns a single model element that has aFeatureValues as values for the index defined by aFeatureNames.

      This method should only be used for indices create with aUniqueIndex == true.

      Parameters:
      aFeatureNames - a List of feature names defining the index to be used.
      aFeatureValues - a List of feature values that should match with the values of the elements to be retrieved.
      Returns:
      A single model element that has aFeatureValues as values for the index defined by aFeatureNames, or null if no such element exist in this model.
      Throws:
      IllegalArgumentException - if no index was added for aFeatureNames, or if the index was created as a non-unique index.
      NullPointerException - if aFeatureNames == null || aFeatureValues == null or one of the feature names is null.
    • removeIndex

      void removeIndex(List aFeatureNames)
      Deprecated.
      Removes an index from the model. If the specified index does not exist in this model, this method has no effect.
      Parameters:
      aFeatureNames - a List of feature names defining the index to be removed.
      Throws:
      NullPointerException - if aFeatureNames or one of its elements is null.
    • canAddIndex

      boolean canAddIndex(List aFeatureNames, boolean aIsUniqueIndex)
      Deprecated.
      Returns whether a useful index can be created for the given list of feature names. Implementations should specify in their documentation which restrictions are placed on the indices they accept.
      Parameters:
      aFeatureNames - a List of feature names defining the index to be validated.
      aIsUniqueIndex - a boolean indicating whether the features used in this index form a unique key for the model elements.
      Returns:
      true if a useful index can be created for the given list of feature names, false otherwise.