[Mulgara-svn] r966 - trunk/src/jar/query/java/org/mulgara/query/filter/value

pag at mulgara.org pag at mulgara.org
Sat May 31 00:03:46 UTC 2008


Author: pag
Date: 2008-05-30 17:03:46 -0700 (Fri, 30 May 2008)
New Revision: 966

Modified:
   trunk/src/jar/query/java/org/mulgara/query/filter/value/Var.java
Log:
Now doing local space comparisons for SameTerm used between variables

Modified: trunk/src/jar/query/java/org/mulgara/query/filter/value/Var.java
===================================================================
--- trunk/src/jar/query/java/org/mulgara/query/filter/value/Var.java	2008-05-31 00:01:40 UTC (rev 965)
+++ trunk/src/jar/query/java/org/mulgara/query/filter/value/Var.java	2008-05-31 00:03:46 UTC (rev 966)
@@ -177,6 +177,7 @@
 
   /** {@inheritDoc} */
   public boolean sameTerm(RDFTerm v) throws QueryException {
+    if (Var.class.equals(v.getClass())) return resolveLocal() == ((Var)v).resolveLocal();
     return resolve().sameTerm(v);
   }
 
@@ -214,7 +215,7 @@
    * @throws QueryException Indicates an error getting data out of the context, or globalizing.
    */
   public RDFTerm resolve() throws QueryException {
-    long gNode = getLocalContext().getColumnValue(varIndex);
+    long gNode = resolveLocal();
 
     Node node;
     try {
@@ -227,6 +228,15 @@
   }
 
   /**
+   * Resolve this variable to the internal gNode.
+   * @return A gNode that this variable resolves to.
+   * @throws QueryException Indicates an error getting data out of the context.
+   */
+  public long resolveLocal() throws QueryException {
+    return getLocalContext().getColumnValue(varIndex);
+  }
+
+  /**
    * Converts a node to an appropriate ExpressionValue
    * @param node The node to convert
    * @return A new ExpressionValue




More information about the Mulgara-svn mailing list