[Mulgara-svn] r1023 - trunk/src/jar/query/java/org/mulgara/query
pag at mulgara.org
pag at mulgara.org
Thu Jun 26 19:09:56 UTC 2008
Author: pag
Date: 2008-06-26 12:09:55 -0700 (Thu, 26 Jun 2008)
New Revision: 1023
Modified:
trunk/src/jar/query/java/org/mulgara/query/Variable.java
Log:
Made comparable, along with a comment to explain the difference between this and a Var
Modified: trunk/src/jar/query/java/org/mulgara/query/Variable.java
===================================================================
--- trunk/src/jar/query/java/org/mulgara/query/Variable.java 2008-06-26 19:09:03 UTC (rev 1022)
+++ trunk/src/jar/query/java/org/mulgara/query/Variable.java 2008-06-26 19:09:55 UTC (rev 1023)
@@ -28,7 +28,11 @@
package org.mulgara.query;
/**
- * Variable nodes.
+ * Variable nodes. These act as a label for columns in a tuple, and not as
+ * elements that are resolvable in a context (compare with
+ * {@link org.mulgara.query.filter.value.Var} which does do this).
+ *
+ * Comparable for the sake of ordering elements by the label and not their value.
*
* @created 2001-07-31
*
@@ -40,7 +44,7 @@
*
* @licence <a href="{@docRoot}/../../LICENCE">Mozilla Public License v1.1</a>
*/
-public class Variable implements SelectElement, ConstraintElement {
+public class Variable implements SelectElement, ConstraintElement, Comparable<Variable> {
/**
* Allow newer compiled version of the stub to operate when changes
@@ -122,4 +126,9 @@
public String toString() {
return "$" + name;
}
+
+
+ public int compareTo(Variable o) {
+ return name.compareTo(o.name);
+ }
}
More information about the Mulgara-svn
mailing list