org.hypergraphdb.query
Class ArityCondition
java.lang.Object
org.hypergraphdb.query.ArityCondition
- All Implemented Interfaces:
- HGAtomPredicate, HGQueryCondition
public class ArityCondition
- extends java.lang.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)).
- Author:
- Borislav Iordanov
| Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
ArityCondition
public ArityCondition()
ArityCondition
public ArityCondition(int arity)
satisfies
public boolean satisfies(HyperGraph hg,
HGHandle handle)
Return true if handle to a HyperGraph link and
false if it refers to a HyperGraph node.
- Specified by:
satisfies in interface HGAtomPredicate
- 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.
hashCode
public int hashCode()
- Overrides:
hashCode in class java.lang.Object
equals
public boolean equals(java.lang.Object x)
- Overrides:
equals in class java.lang.Object
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
getArity
public int getArity()
setArity
public void setArity(int arity)