public class ArityCondition extends Object implements HGQueryCondition, HGAtomPredicate
The ArityCondition is a simply predicate condition that checks the arity
(i.e. the size of a target set) of its argument. A link is an atom whose target set has an arity > 0.
Thus to check whether an atom is a link, one can use the condition new Not(new ArityCondition(0)).
| Constructor and Description |
|---|
ArityCondition() |
ArityCondition(int arity) |
ArityCondition(Ref<Integer> arity) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object x) |
int |
getArity() |
Ref<Integer> |
getArityReference() |
int |
hashCode() |
boolean |
satisfies(HyperGraph hg,
HGHandle handle)
Return true if
handle to a HyperGraph link and
false if it refers to a HyperGraph node. |
void |
setArity(int arity) |
void |
setArityReference(Ref<Integer> arity) |
String |
toString() |
public ArityCondition()
public ArityCondition(int arity)
public boolean satisfies(HyperGraph hg, HGHandle handle)
Return true if handle to a HyperGraph link and
false if it refers to a HyperGraph node.
satisfies in interface HGAtomPredicatehg - 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 int getArity()
public void setArity(int arity)
Copyright © 2015. All rights reserved.