public class TypedValueCondition extends AtomValueCondition implements TypeCondition
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
.
operator, value
Constructor and Description |
---|
TypedValueCondition() |
TypedValueCondition(Class<?> javaClass,
Object value) |
TypedValueCondition(Class<?> javaClass,
Object value,
ComparisonOperator op) |
TypedValueCondition(HGHandle typeHandle,
Object value) |
TypedValueCondition(HGHandle typeHandle,
Object value,
ComparisonOperator op) |
TypedValueCondition(Ref<?> type,
Ref<Object> value) |
TypedValueCondition(Ref<?> type,
Ref<Object> value,
ComparisonOperator op) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object x) |
Class<?> |
getJavaClass() |
HGHandle |
getTypeHandle() |
HGHandle |
getTypeHandle(HyperGraph graph) |
Ref<?> |
getTypeReference() |
int |
hashCode() |
boolean |
satisfies(HyperGraph hg,
HGHandle handle)
Check whether a given
Object satisfies this
query condition. |
void |
setJavaClass(Class<?> c) |
void |
setTypeHandle(HGHandle handle) |
void |
setTypeReference(Ref<?> type) |
String |
toString() |
compareToValue, getOperator, getValue, getValueReference, setOperator, setValue, setValueReference
public TypedValueCondition()
public TypedValueCondition(Ref<?> type, Ref<Object> value, ComparisonOperator op)
public TypedValueCondition(HGHandle typeHandle, Object value, ComparisonOperator op)
public TypedValueCondition(Class<?> javaClass, Object value, ComparisonOperator op)
public boolean satisfies(HyperGraph hg, HGHandle handle)
HGAtomPredicate
Check whether a given Object
satisfies this
query condition.
satisfies
in interface HGAtomPredicate
satisfies
in class AtomValueCondition
hg
- The HyperGraph
instance.handle
- The atom on which to test the query condition.true
if the passed in parameter satisfies
the condition and false
otherwise.public Ref<?> getTypeReference()
getTypeReference
in interface TypeCondition
public void setTypeReference(Ref<?> type)
public void setJavaClass(Class<?> c)
public Class<?> getJavaClass()
public void setTypeHandle(HGHandle handle)
public HGHandle getTypeHandle()
public HGHandle getTypeHandle(HyperGraph graph)
public String toString()
toString
in class AtomValueCondition
public int hashCode()
hashCode
in class AtomValueCondition
public boolean equals(Object x)
equals
in class AtomValueCondition
Copyright © 2015. All rights reserved.