Class StandingQueryAttribute<O>

  • All Implemented Interfaces:
    Attribute<O,​Boolean>

    public class StandingQueryAttribute<O>
    extends MultiValueAttribute<O,​Boolean>
    An attribute which wraps a query or query fragment. Any index built on this attribute, will accelerate the entire query or query fragment encapsulated in this attribute, returning results for it in constant time complexity O(1).

    When an index based on a StandingQueryAttribute is added to the collection, objects added to the collection will then be tested to see if they match this query. If and only if they match the query exactly, they will be added to the index. Subsequently if CQEngine finds the given query in its entirety, or as a branch or fragment of a larger query, then it will use the index to answer it in O(1) time complexity.

    Author:
    niall.gallagher
    • Constructor Detail

      • StandingQueryAttribute

        public StandingQueryAttribute​(Query<O> standingQuery)
    • Method Detail

      • getQuery

        public Query<O> getQuery()
      • getValues

        public Iterable<Boolean> getValues​(O object,
                                           QueryOptions queryOptions)
        Description copied from class: MultiValueAttribute
        Returns the non-null values of the attribute from the object.

        Specified by:
        getValues in interface Attribute<O,​Boolean>
        Specified by:
        getValues in class MultiValueAttribute<O,​Boolean>
        Parameters:
        object - The object from which the values of the attribute are required
        queryOptions - Optional parameters supplied by the application along with the operation which is causing this attribute to be invoked (either a query, or an update to the collection)
        Returns:
        The values for the attribute, which should never be null