Class ResultSetUnionAll<O>
- java.lang.Object
-
- com.googlecode.cqengine.resultset.ResultSet<O>
-
- com.googlecode.cqengine.resultset.connective.ResultSetUnionAll<O>
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Iterable<O>
public class ResultSetUnionAll<O> extends ResultSet<O>
A ResultSet which provides a view onto the union of other ResultSets, without deduplication. This is equivalent to UNION ALL in SQL terminology, i.e. duplicates are not eliminated.- Author:
- Niall Gallagher
-
-
Constructor Summary
Constructors Constructor Description ResultSetUnionAll(Iterable<? extends ResultSet<O>> resultSets, Query<O> query, QueryOptions queryOptions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes all of the underlyingResultSet
s.boolean
contains(O object)
Returns true if the given object is contained in any underlying ResultSets.int
getMergeCost()
Returns the sum of the merge costs of the the underlyingResultSet
s.Query<O>
getQuery()
Returns the query for which this ResultSet provides results.QueryOptions
getQueryOptions()
Returns the query options associated with the query.int
getRetrievalCost()
Returns the sum of the retrieval costs of the the underlyingResultSet
s.Iterator<O>
iterator()
boolean
matches(O object)
Similar to theResultSet.contains(Object)
method, but checks for logical containment in the ResultSet as opposed to physical containment in the ResultSet.int
size()
Returns the sum of the sizes of the the underlyingResultSet
s.-
Methods inherited from class com.googlecode.cqengine.resultset.ResultSet
isEmpty, isNotEmpty, spliterator, stream, uniqueResult
-
-
-
-
Method Detail
-
contains
public boolean contains(O object)
Returns true if the given object is contained in any underlying ResultSets.
-
matches
public boolean matches(O object)
Description copied from class:ResultSet
Similar to theResultSet.contains(Object)
method, but checks for logical containment in the ResultSet as opposed to physical containment in the ResultSet. Determines if the given object would be contained in the ResultSet, by testing if the given object matches the query for which this ResultSet was generated, instead of actually checking if the object is contained in appropriate indexes. This method will typically make the determination by evaluating the query on the given object on-the-fly without accessing indexes, however in some cases this method might delegate to theResultSet.contains(Object)
method to make the determination. This method will perform better thanResultSet.contains(Object)
in cases where querying indexes is more expensive than querying attributes, which is usually the case.
-
size
public int size()
Returns the sum of the sizes of the the underlyingResultSet
s.
-
getRetrievalCost
public int getRetrievalCost()
Returns the sum of the retrieval costs of the the underlyingResultSet
s.- Specified by:
getRetrievalCost
in classResultSet<O>
- Returns:
- the sum of the retrieval costs of the the underlying
ResultSet
s
-
getMergeCost
public int getMergeCost()
Returns the sum of the merge costs of the the underlyingResultSet
s.- Specified by:
getMergeCost
in classResultSet<O>
- Returns:
- the sum of the merge costs of the the underlying
ResultSet
s
-
close
public void close()
Closes all of the underlyingResultSet
s.
-
getQuery
public Query<O> getQuery()
Description copied from class:ResultSet
Returns the query for which this ResultSet provides results.
-
getQueryOptions
public QueryOptions getQueryOptions()
Description copied from class:ResultSet
Returns the query options associated with the query.- Specified by:
getQueryOptions
in classResultSet<O>
- Returns:
- The query options associated with the query.
-
-