uk.ac.ic.doc.rodex.qproc
Class QueryVariable

java.lang.Object
  extended by uk.ac.ic.doc.rodex.qproc.QueryVariable

public class QueryVariable
extends java.lang.Object


Constructor Summary
QueryVariable(java.lang.String varName)
          Creates a new instance of QueryVariable
 
Method Summary
 void addBoundField(java.lang.String boundField)
          Add variable to which this head var is bound to
 void addBoundFunction(QueryFunction qf)
          Add a reference to a QueryFunction object that uses this variable
 void addSubGoal(QuerySubGoal subGoal)
          Add a new sub goal object that uses this shared variable
 boolean equals(java.lang.Object var)
          Compare string-representation of two query variable objects
 java.util.List getBoundFields()
          Getter for bounded fields
 java.util.List getBoundFunctions()
          Getter for bound functions
 java.lang.String getName()
           
 java.util.List getSubGoals()
          Return a list of QuerySubGoal objects which refer to this variable
 boolean isConsistentWith(QueryVariable var)
          Two QueryVariable objects are consistent if their bound functions (if any)
are mutually consistent.
 boolean isConstant()
          Test if this variable is also a query constant, i.e.
 boolean isMappableTo(QueryVariable var)
          Two QueryVariable objects are mappable if they are bound to the
same field in a query scheme (e.g.
 boolean isShared()
          Test to see if this is a shared variable, i.e.
 java.lang.String toString()
          Return a String representation of the query variable
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QueryVariable

public QueryVariable(java.lang.String varName)
Creates a new instance of QueryVariable

Method Detail

addSubGoal

public void addSubGoal(QuerySubGoal subGoal)
Add a new sub goal object that uses this shared variable

Parameters:
subGoal - a reference to a QuerySubGoal object

addBoundFunction

public void addBoundFunction(QueryFunction qf)
Add a reference to a QueryFunction object that uses this variable


isShared

public boolean isShared()
Test to see if this is a shared variable, i.e. is linked to more than one
sub-goals

Returns:
boolean true if this is a shared variable, false otherwise

isConstant

public boolean isConstant()
Test if this variable is also a query constant, i.e. it is associated to one equal (=) function


getSubGoals

public java.util.List getSubGoals()
Return a list of QuerySubGoal objects which refer to this variable


equals

public boolean equals(java.lang.Object var)
Compare string-representation of two query variable objects

Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Return a String representation of the query variable

Overrides:
toString in class java.lang.Object

getName

public java.lang.String getName()

addBoundField

public void addBoundField(java.lang.String boundField)
Add variable to which this head var is bound to


getBoundFields

public java.util.List getBoundFields()
Getter for bounded fields


getBoundFunctions

public java.util.List getBoundFunctions()
Getter for bound functions


isConsistentWith

public boolean isConsistentWith(QueryVariable var)
Two QueryVariable objects are consistent if their bound functions (if any)
are mutually consistent.

Parameters:
var - another QueryVariable object
Returns:
boolean true of two objects are mappable, false otherwise

isMappableTo

public boolean isMappableTo(QueryVariable var)
Two QueryVariable objects are mappable if they are bound to the
same field in a query scheme (e.g. same database column)