org.hypergraphdb.query.impl
Class SearchableBasedQuery

java.lang.Object
  extended by org.hypergraphdb.HGQuery
      extended by org.hypergraphdb.query.impl.KeyBasedQuery
          extended by org.hypergraphdb.query.impl.SearchableBasedQuery
All Implemented Interfaces:
HGGraphHolder

public class SearchableBasedQuery
extends KeyBasedQuery

A simple query that operates on a single HGSearchable entity, usually a HGIndex.

Author:
Borislav Iordanov

Nested Class Summary
 
Nested classes/interfaces inherited from class org.hypergraphdb.HGQuery
HGQuery.hg
 
Field Summary
 
Fields inherited from class org.hypergraphdb.HGQuery
NOP
 
Constructor Summary
SearchableBasedQuery(HGSearchable searchable, java.lang.Object key, ComparisonOperator operator)
           Construct a new HGSearchable based query.
 
Method Summary
 HGSearchResult execute()
           
 java.lang.Object getKey()
          Retrieve the key object used to perform this query.
 ComparisonOperator getOperator()
           
 HGSearchable getSearchable()
           
 void setKey(java.lang.Object key)
          Specify the key on which this query operates.
 void setOperator(ComparisonOperator operator)
           
 void setSearchable(HGSearchable searchable)
           
 
Methods inherited from class org.hypergraphdb.HGQuery
getHyperGraph, make, setHyperGraph
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchableBasedQuery

public SearchableBasedQuery(HGSearchable searchable,
                            java.lang.Object key,
                            ComparisonOperator operator)

Construct a new HGSearchable based query.

Parameters:
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.
Method Detail

execute

public HGSearchResult execute()
Specified by:
execute in class HGQuery

setKey

public void setKey(java.lang.Object key)
Description copied from class: KeyBasedQuery

Specify the key on which this query operates.

Specified by:
setKey in class KeyBasedQuery
Parameters:
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.

getKey

public java.lang.Object getKey()
Description copied from class: KeyBasedQuery

Retrieve the key object used to perform this query.

Specified by:
getKey in class KeyBasedQuery

setOperator

public void setOperator(ComparisonOperator operator)

getOperator

public ComparisonOperator getOperator()

setSearchable

public void setSearchable(HGSearchable searchable)

getSearchable

public HGSearchable getSearchable()