org.hypergraphdb.query
Class LinkCondition

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

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

A LinkCondition constraints the query result set to links pointing to a target set of atoms. The target set is specified when the condition is constructed through an array of HGHandles.

Author:
Borislav Iordanov

Constructor Summary
LinkCondition()
           
LinkCondition(HGHandle[] targets)
           
 
Method Summary
 boolean equals(java.lang.Object x)
           
 java.util.HashSet<HGHandle> getTargetSet()
           
 int hashCode()
           
 boolean satisfies(HyperGraph hg, HGHandle handle)
          Return true if handle points to a link whose target set is a superset of this condition's targetSet.
 void setTargetSet(java.util.HashSet<HGHandle> targetSet)
           
 java.util.HashSet<HGHandle> targets()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LinkCondition

public LinkCondition()

LinkCondition

public LinkCondition(HGHandle[] targets)
Method Detail

targets

public java.util.HashSet<HGHandle> targets()

getTargetSet

public java.util.HashSet<HGHandle> getTargetSet()

setTargetSet

public void setTargetSet(java.util.HashSet<HGHandle> targetSet)

satisfies

public boolean satisfies(HyperGraph hg,
                         HGHandle handle)

Return true if handle points to a link whose target set is a superset of this condition's targetSet.

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