Class LogicalQuery<O>
- java.lang.Object
-
- com.googlecode.cqengine.query.logical.LogicalQuery<O>
-
- Type Parameters:
O
- The type of the object containing the attributes on which child queries in the query make assertions
- All Implemented Interfaces:
Query<O>
public abstract class LogicalQuery<O> extends Object implements Query<O>
The superclass ofQuery
s which logically connect other queries together to form complex queries.- Since:
- 2012-04-30 16:56
- Author:
- ngallagher
-
-
Field Summary
Fields Modifier and Type Field Description protected Collection<Query<O>>
childQueries
-
Constructor Summary
Constructors Constructor Description LogicalQuery(Collection<Query<O>> childQueries)
Creates a newLogicalQuery
initialized to logically connect the supplied set of child queries.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract int
calcHashCode()
Collection<Query<O>>
getChildQueries()
The entire collection of child queries, which may be eitherSimpleQuery
s orLogicalQuery
s.List<ComparativeQuery<O,?>>
getComparativeQueries()
Returns a collection of child queries which are themselvesComparativeQuery
s.List<LogicalQuery<O>>
getLogicalQueries()
Returns a collection of child queries which are themselvesLogicalQuery
s.List<SimpleQuery<O,?>>
getSimpleQueries()
Returns a collection of child queries which are themselvesSimpleQuery
s.boolean
hasComparativeQueries()
Returns true if this logical query has child queries which are themselvesComparativeQuery
s.int
hashCode()
boolean
hasLogicalQueries()
Returns true if this logical query has child queries which are themselvesLogicalQuery
s.boolean
hasSimpleQueries()
Returns true if this logical query has child queries which are themselvesSimpleQuery
s.int
size()
Returns the total number of child queries (both logical and simple).
-
-
-
Field Detail
-
childQueries
protected final Collection<Query<O>> childQueries
-
-
Constructor Detail
-
LogicalQuery
public LogicalQuery(Collection<Query<O>> childQueries)
Creates a newLogicalQuery
initialized to logically connect the supplied set of child queries.- Parameters:
childQueries
- The child queries which thisLogicalQuery
is to logically connect
-
-
Method Detail
-
getLogicalQueries
public List<LogicalQuery<O>> getLogicalQueries()
Returns a collection of child queries which are themselvesLogicalQuery
s.- Returns:
- a collection of child queries which are themselves
LogicalQuery
s
-
getSimpleQueries
public List<SimpleQuery<O,?>> getSimpleQueries()
Returns a collection of child queries which are themselvesSimpleQuery
s.- Returns:
- a collection of child queries which are themselves
SimpleQuery
s
-
getComparativeQueries
public List<ComparativeQuery<O,?>> getComparativeQueries()
Returns a collection of child queries which are themselvesComparativeQuery
s.- Returns:
- a collection of child queries which are themselves
ComparativeQuery
s
-
getChildQueries
public Collection<Query<O>> getChildQueries()
The entire collection of child queries, which may be eitherSimpleQuery
s orLogicalQuery
s.- Returns:
- The entire collection of child queries, which may be either
SimpleQuery
s orLogicalQuery
s.
-
hasLogicalQueries
public boolean hasLogicalQueries()
Returns true if this logical query has child queries which are themselvesLogicalQuery
s.- Returns:
- true if this logical query has child queries which are themselves
LogicalQuery
s, false if this logical query has no child queries which are themselvesLogicalQuery
s
-
hasSimpleQueries
public boolean hasSimpleQueries()
Returns true if this logical query has child queries which are themselvesSimpleQuery
s.- Returns:
- true if this logical query has child queries which are themselves
SimpleQuery
s, false if this logical query has no child queries which are themselvesSimpleQuery
s
-
hasComparativeQueries
public boolean hasComparativeQueries()
Returns true if this logical query has child queries which are themselvesComparativeQuery
s.- Returns:
- true if this logical query has child queries which are themselves
ComparativeQuery
s, false if this logical query has no child queries which are themselvesComparativeQuery
s
-
size
public int size()
Returns the total number of child queries (both logical and simple).- Returns:
- the total number of child queries (both logical and simple)
-
calcHashCode
protected abstract int calcHashCode()
-
-