Class MetadataEngine<O>


  • public class MetadataEngine<O>
    extends Object
    Provides access to metadata for attributes, obtained from indexes which have been added to the collection. Example metadata:
    • frequency distributions (counts of the occurrences of each distinct value of an attribute in the collection)
    • count the number of objects in the collection whose attribute has a specific value
    • obtain all of the distinct values of an attribute

    The getAttributeMetadata(Attribute) method returns an AttributeMetadata accessor object, which can provide access to basic metadata as discussed above for a given attribute, in unsorted order. This requires in advance, an index which implements the KeyStatisticsAttributeIndex interface, to be added to the collection on the given attribute. Most indexes implement that interface.

    The getSortedAttributeMetadata(Attribute) method returns a SortedAttributeMetadata accessor object, which can provide access to additional metadata and in sorted order. It allows attribute values to be traversed in ascending or descending order, and it supports range queries. This requires in advance, an index which implements the SortedKeyStatisticsAttributeIndex interface, to be added to the collection on the given attribute. That interface is implemented by many indexes.

    This object can be accessed by calling IndexedCollection.getMetadataEngine().