Class OffHeapIndex<A extends Comparable<A>,O,K extends Comparable<K>>
- java.lang.Object
-
- com.googlecode.cqengine.index.sqlite.SimplifiedSQLiteIndex<A,O,K>
-
- com.googlecode.cqengine.index.offheap.OffHeapIndex<A,O,K>
-
- All Implemented Interfaces:
ModificationListener<O>
,AttributeIndex<A,O>
,Index<O>
,NonHeapTypeIndex
,OffHeapTypeIndex
,KeyStatisticsAttributeIndex<A,O>
,KeyStatisticsIndex<A,O>
,SortedKeyStatisticsAttributeIndex<A,O>
,SortedKeyStatisticsIndex<A,O>
public class OffHeapIndex<A extends Comparable<A>,O,K extends Comparable<K>> extends SimplifiedSQLiteIndex<A,O,K> implements OffHeapTypeIndex
An index persisted in native memory within the JVM process but outside the Java heap. This index is similar to the on-heapNavigableIndex
and supports the same types of queries. The current implementation of this index is based onSQLiteIndex
.- Author:
- niall.gallagher
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <A extends Comparable<A>,O>
OffHeapIndex<A,O,? extends Comparable<?>>onAttribute(Attribute<O,A> attribute)
Creates a newOffHeapIndex
.ResultSet<O>
retrieve(Query<O> query, QueryOptions queryOptions)
Returns aResultSet
which when iterated will return objects from the index matching the query supplied.-
Methods inherited from class com.googlecode.cqengine.index.sqlite.SimplifiedSQLiteIndex
addAll, clear, destroy, equals, getAttribute, getCountForKey, getCountOfDistinctKeys, getDistinctKeys, getDistinctKeys, getDistinctKeysDescending, getDistinctKeysDescending, getEffectiveIndex, getKeysAndValues, getKeysAndValues, getKeysAndValuesDescending, getKeysAndValuesDescending, getStatisticsForDistinctKeys, getStatisticsForDistinctKeysDescending, hashCode, init, isMutable, isQuantized, removeAll, supportsQuery
-
-
-
-
Method Detail
-
retrieve
public ResultSet<O> retrieve(Query<O> query, QueryOptions queryOptions)
Description copied from interface:Index
Returns aResultSet
which when iterated will return objects from the index matching the query supplied. UsuallyResultSet
s 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 theResultSet
.- Specified by:
retrieve
in interfaceIndex<A extends Comparable<A>>
- Overrides:
retrieve
in classSimplifiedSQLiteIndex<A extends Comparable<A>,O,K extends Comparable<K>>
- Parameters:
query
- An object which specifies some restriction on an attribute of an objectqueryOptions
- 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)
-
onAttribute
public static <A extends Comparable<A>,O> OffHeapIndex<A,O,? extends Comparable<?>> onAttribute(Attribute<O,A> attribute)
Creates a newOffHeapIndex
.- Type Parameters:
A
- The type of the attribute to be indexed.O
- The type of the object containing the attribute.- Parameters:
attribute
- TheAttribute
on which the index will be built.- Returns:
- An
OffHeapIndex
on the given attribute.
-
-