Class InvertedRadixTreeIndex<A extends CharSequence,​O>

    • Constructor Detail

      • InvertedRadixTreeIndex

        protected InvertedRadixTreeIndex​(Attribute<O,​A> attribute)
        Package-private constructor, used by static factory methods.
      • InvertedRadixTreeIndex

        protected InvertedRadixTreeIndex​(Attribute<O,​A> attribute,
                                         com.googlecode.concurrenttrees.radix.node.NodeFactory nodeFactory)
        Package-private constructor, used by static factory methods.
    • Method Detail

      • isMutable

        public boolean isMutable()
        Description copied from interface: Index
        Indicates if objects can be added to or removed from the index after the index has been built.
        Specified by:
        isMutable in interface Index<A extends CharSequence>
        Returns:
        True if objects can be added to or removed from the index after the index has been built, false if the index cannot be modified after it is built
      • isQuantized

        public boolean isQuantized()
        Description copied from interface: Index
        Indicates if the index is quantized, using a Quantizer.
        Specified by:
        isQuantized in interface Index<A extends CharSequence>
        Returns:
        True if the index is quantized, false if not.
      • getEffectiveIndex

        public Index<O> getEffectiveIndex()
        Description copied from interface: Index
        Returns the effective index, which Persistence objects will use to determine the identity of the index making persistence requests. Most Index implementations will typically return a reference to themselves ('this'). However in advanced cases when one index delegates to another, the implementation of the wrapping index will create a subclass the delegate index, and override this method in the delegate index so that when the delegate index interacts with the persistence, it will identify itself as the outer or "effective" index.
        Specified by:
        getEffectiveIndex in interface Index<A extends CharSequence>
        Returns:
        The effective index, in the case that this index is wrapped by another index.
      • retrieve

        public ResultSet<O> retrieve​(Query<O> query,
                                     QueryOptions queryOptions)
        Description copied from interface: Index
        Returns a ResultSet which when iterated will return objects from the index matching the query supplied.

        Usually ResultSets are lazy which means that they don't actually do any work, or encapsulate or materialize matching objects, but rather they encapsulate logic to fetch matching objects from the index on-the-fly as the application iterates through the ResultSet.

        Specified by:
        retrieve in interface Index<A extends CharSequence>
        Parameters:
        query - An object which specifies some restriction on an attribute of an object
        queryOptions - Optional parameters for the query
        Returns:
        A set of objects with attributes matching the restriction imposed by the query
        See Also:
        Index.supportsQuery(Query, QueryOptions)
      • addAll

        public boolean addAll​(ObjectSet<O> objectSet,
                              QueryOptions queryOptions)
        Notifies the listener that the specified objects are being added to the collection, and so it can take action and update its internal data structures.
        Specified by:
        addAll in interface ModificationListener<A extends CharSequence>
        Parameters:
        objectSet - The objects being added
        queryOptions - Optional parameters for the update
      • removeAll

        public boolean removeAll​(ObjectSet<O> objectSet,
                                 QueryOptions queryOptions)
        Notifies the listener that the specified objects are being removed from the collection, and so it can take action and update its internal data structures.
        Specified by:
        removeAll in interface ModificationListener<A extends CharSequence>
        Parameters:
        objectSet - The objects being removed
        queryOptions - Optional parameters for the update
      • init

        public void init​(ObjectStore<O> objectStore,
                         QueryOptions queryOptions)
        Notifies the listener that the given ObjectStore has just been created.
        Specified by:
        init in interface ModificationListener<A extends CharSequence>
        Parameters:
        objectStore - The ObjectStore which persists objects
        queryOptions - Optional parameters for the update
      • clear

        public void clear​(QueryOptions queryOptions)
        Notifies the listener that all objects have been removed from the collection, and so it can take action and update its internal data structures.
        Specified by:
        clear in interface ModificationListener<A extends CharSequence>
        Parameters:
        queryOptions - Optional parameters for the update
      • onAttributeUsingNodeFactory

        public static <A extends CharSequence,​O> InvertedRadixTreeIndex<A,​O> onAttributeUsingNodeFactory​(Attribute<O,​A> attribute,
                                                                                                                     com.googlecode.concurrenttrees.radix.node.NodeFactory nodeFactory)
        Creates a new InvertedRadixTreeIndex on the specified attribute.

        Type Parameters:
        O - The type of the object containing the attribute
        Parameters:
        attribute - The attribute on which the index will be built
        nodeFactory - The NodeFactory to be used by the tree
        Returns:
        A InvertedRadixTreeIndex on this attribute