org.openanzo.glitter.query.planning
Class TripleNode

java.lang.Object
  extended by org.openanzo.glitter.query.planning.TripleNode
All Implemented Interfaces:
java.lang.Comparable<TripleNode>

public class TripleNode
extends java.lang.Object
implements java.lang.Comparable<TripleNode>

An TripleNode wraps a TriplePatternNode and allows for stateful comparison of two such nodes based on the number of free variables in each triple pattern.

Author:
lee

Constructor Summary
TripleNode(TriplePatternNode t)
          Constructor.
 
Method Summary
 void buildMatch(TripleNode node)
          Checks this TripleNode against the supplied triple node to see if they contain variables in common.
 boolean checkMatch(Variable variable)
           
 int compareTo(TripleNode otherNode)
           
 int getMatchedVariableCount()
           
 TriplePatternNode getTriple()
           
 int getUnMatchedVariableCount()
           
 int getVarCount()
           
 java.util.Collection<Variable> getVariables()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TripleNode

public TripleNode(TriplePatternNode t)
Constructor.

Parameters:
t -
Method Detail

getTriple

public TriplePatternNode getTriple()
Returns:
The TriplePatternNode corresponding to this object.

getVarCount

public int getVarCount()
Returns:
The number of variables in this triple pattern

getVariables

public java.util.Collection<Variable> getVariables()
Returns:
The variables in this triple pattern

getMatchedVariableCount

public int getMatchedVariableCount()
Returns:
The number of variables that have been matched via calls to checkMatch(Variable)

getUnMatchedVariableCount

public int getUnMatchedVariableCount()
Returns:
The number of variables in this triple pattern not yet matched via calls to checkMatch(Variable)

buildMatch

public void buildMatch(TripleNode node)
Checks this TripleNode against the supplied triple node to see if they contain variables in common.

Parameters:
node -

checkMatch

public boolean checkMatch(Variable variable)
Parameters:
variable -
Returns:
true, if the given variable occurs in this triple pattern; false, otherwise

compareTo

public int compareTo(TripleNode otherNode)
Specified by:
compareTo in interface java.lang.Comparable<TripleNode>


Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.