org.hypergraphdb.query
Class TypedValueCondition
java.lang.Object
org.hypergraphdb.query.SimpleValueCondition
org.hypergraphdb.query.AtomValueCondition
org.hypergraphdb.query.TypedValueCondition
- All Implemented Interfaces:
- HGAtomPredicate, HGQueryCondition
public class TypedValueCondition
- extends AtomValueCondition
This is a HGQueryCondition that constrains the value of an
atom as well as its type. In general, the HyperGraph type system allows
values to have multiple types. Two atoms X and
Y can share the same value V without however
having the same type. X may be of type T and
Y may be of type S different than T.
In such situations, when performing a query by value, a TypedValueCondition
should be used instead of AtomValueCondition.
- Author:
- Borislav Iordanov
| Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
TypedValueCondition
public TypedValueCondition()
TypedValueCondition
public TypedValueCondition(HGHandle typeHandle,
java.lang.Object value)
TypedValueCondition
public TypedValueCondition(java.lang.Class<?> javaClass,
java.lang.Object value)
TypedValueCondition
public TypedValueCondition(HGHandle typeHandle,
java.lang.Object value,
ComparisonOperator op)
TypedValueCondition
public TypedValueCondition(java.lang.Class<?> javaClass,
java.lang.Object value,
ComparisonOperator op)
satisfies
public boolean satisfies(HyperGraph hg,
HGHandle handle)
- Description copied from interface:
HGAtomPredicate
Check whether a given Object satisfies this
query condition.
- Specified by:
satisfies in interface HGAtomPredicate- Overrides:
satisfies in class AtomValueCondition
- Parameters:
hg - The HyperGraph instance.handle - The atom on which to test the query condition.
- Returns:
true if the passed in parameter satisfies
the condition and false otherwise.
setTypeHandle
public void setTypeHandle(HGHandle typeHandle)
getTypeHandle
public HGHandle getTypeHandle()
setJavaClass
public void setJavaClass(java.lang.Class<?> javaClass)
getJavaClass
public java.lang.Class<?> getJavaClass()
toString
public java.lang.String toString()
- Overrides:
toString in class AtomValueCondition
hashCode
public int hashCode()
- Overrides:
hashCode in class AtomValueCondition
equals
public boolean equals(java.lang.Object x)
- Overrides:
equals in class AtomValueCondition