Class StandingQueryAttribute<O>
- java.lang.Object
-
- com.googlecode.cqengine.attribute.support.AbstractAttribute<O,A>
-
- com.googlecode.cqengine.attribute.MultiValueAttribute<O,Boolean>
-
- com.googlecode.cqengine.attribute.StandingQueryAttribute<O>
-
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 aStandingQueryAttribute
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 Summary
Constructors Constructor Description StandingQueryAttribute(Query<O> standingQuery)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class<O>
getObjectType()
Returns the type of the object which contains the attribute.Query<O>
getQuery()
Iterable<Boolean>
getValues(O object, QueryOptions queryOptions)
Returns the non-null values of the attribute from the object.-
Methods inherited from class com.googlecode.cqengine.attribute.support.AbstractAttribute
calcHashCode, canEqual, equals, getAttributeName, getAttributeType, hashCode, toString
-
-
-
-
Method Detail
-
getObjectType
public Class<O> getObjectType()
Description copied from interface:Attribute
Returns the type of the object which contains the attribute.- Specified by:
getObjectType
in interfaceAttribute<O,Boolean>
- Overrides:
getObjectType
in classAbstractAttribute<O,Boolean>
- Returns:
- the type of the object which contains the attribute
-
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 interfaceAttribute<O,Boolean>
- Specified by:
getValues
in classMultiValueAttribute<O,Boolean>
- Parameters:
object
- The object from which the values of the attribute are requiredqueryOptions
- 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
-
-