org.hypergraphdb.query
Class AtomTypeCondition

java.lang.Object
  extended by org.hypergraphdb.query.AtomTypeCondition
All Implemented Interfaces:
HGAtomPredicate, HGQueryCondition

public class AtomTypeCondition
extends java.lang.Object
implements HGQueryCondition, HGAtomPredicate

An AtomTypeCondition examines the type of a given atom and evaluates to true or false depending on whether the type of the atom matches exactly (i.e. has the same type handle) as that of the condition. Note that this condition looks at the concrete type of the atom and ignores and sub-typing relationships.

The type can be specified either as a HyperGraph handle or as a Java class. In the latter, the corresponding HyperGraph will be retrieved at appropriate times.

Author:
Borislav Iordanov

Constructor Summary
AtomTypeCondition(java.lang.Class javaClass)
           
AtomTypeCondition(HGHandle typeHandle)
           
 
Method Summary
 java.lang.Class getJavaClass()
           
 HGHandle getTypeHandle()
           
 boolean satisfies(HyperGraph hg, HGHandle value)
          Check whether a given Object satisfies this query condition.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AtomTypeCondition

public AtomTypeCondition(java.lang.Class javaClass)

AtomTypeCondition

public AtomTypeCondition(HGHandle typeHandle)
Method Detail

getJavaClass

public java.lang.Class getJavaClass()

getTypeHandle

public HGHandle getTypeHandle()

satisfies

public boolean satisfies(HyperGraph hg,
                         HGHandle value)
Description copied from interface: HGAtomPredicate

Check whether a given Object satisfies this query condition.

Specified by:
satisfies in interface HGAtomPredicate
Parameters:
hg - The HyperGraph instance.
value - The atom on which to test the query condition.
Returns:
true if the passed in parameter satisfies the condition and false otherwise.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object