public class SearchableBasedQuery<Key,Value> extends KeyBasedQuery<Key,Value>
A simple query that operates on a single HGSearchable
entity, usually
a HGIndex
.
HGQuery.hg
Modifier and Type | Field and Description |
---|---|
protected Ref<Key> |
key |
protected HGSearchable<Key,Value> |
searchable |
Constructor and Description |
---|
SearchableBasedQuery(HGSearchable<Key,Value> searchable,
Key key,
ComparisonOperator operator)
Construct a new
HGSearchable based query. |
SearchableBasedQuery(HGSearchable<Key,Value> searchable,
Ref<Key> key,
ComparisonOperator operator) |
Modifier and Type | Method and Description |
---|---|
HGSearchResult<Value> |
execute()
Execute the query and return the result set.
|
Key |
getKey()
Retrieve the key object used to perform this query.
|
Ref<Key> |
getKeyReference() |
ComparisonOperator |
getOperator() |
HGSearchable<Key,Value> |
getSearchable() |
void |
setKey(Key key)
Specify the key on which this query operates.
|
void |
setKeyReference(Ref<Key> key) |
void |
setOperator(ComparisonOperator operator) |
void |
setSearchable(HGSearchable<Key,Value> searchable) |
compile, findAll, findInSet, findOne, getHyperGraph, initialValue, initialVar, make, make, NOP, setHyperGraph, var, var
protected HGSearchable<Key,Value> searchable
public SearchableBasedQuery(HGSearchable<Key,Value> searchable, Key key, ComparisonOperator operator)
Construct a new HGSearchable
based query.
searchable
- The instance that will be searched.key
- The search key.operator
- A ComparisonOperator
for the search. If it is
something else than a ComparisonOperator.EQ
operator, it must be
supported by the concrete HGSearchable
object passed. For instance,
an order operator like ComparisonOperator.LT
and the like requires
a HGOrderedSearchable
instance.public SearchableBasedQuery(HGSearchable<Key,Value> searchable, Ref<Key> key, ComparisonOperator operator)
public HGSearchResult<Value> execute()
HGQuery
Execute the query and return the result set. Note that queries are lazily executed so that
results are actually obtained when one iterates (using the next
and prev
of the returned object).
public void setKey(Key key)
KeyBasedQuery
Specify the key on which this query operates.
setKey
in class KeyBasedQuery<Key,Value>
key
- The key object. The value may be interpreted differently
based on the concrete HGQuery
instance. Usually it
should be either a byte []
or convertible to one.public Key getKey()
KeyBasedQuery
Retrieve the key object used to perform this query.
getKey
in class KeyBasedQuery<Key,Value>
public void setOperator(ComparisonOperator operator)
public ComparisonOperator getOperator()
public void setSearchable(HGSearchable<Key,Value> searchable)
public HGSearchable<Key,Value> getSearchable()
Copyright © 2015. All rights reserved.