[Mulgara-svn] r708 - branches/mgr-61-sparql/src/jar/tuples/java/org/mulgara/store/tuples

pag at mulgara.org pag at mulgara.org
Tue Mar 25 05:14:35 UTC 2008


Author: pag
Date: 2008-03-24 22:14:34 -0700 (Mon, 24 Mar 2008)
New Revision: 708

Modified:
   branches/mgr-61-sparql/src/jar/tuples/java/org/mulgara/store/tuples/TuplesOperations.java
Log:
Constructs a FilteredTuples with a new filter() method

Modified: branches/mgr-61-sparql/src/jar/tuples/java/org/mulgara/store/tuples/TuplesOperations.java
===================================================================
--- branches/mgr-61-sparql/src/jar/tuples/java/org/mulgara/store/tuples/TuplesOperations.java	2008-03-25 05:13:40 UTC (rev 707)
+++ branches/mgr-61-sparql/src/jar/tuples/java/org/mulgara/store/tuples/TuplesOperations.java	2008-03-25 05:14:34 UTC (rev 708)
@@ -37,6 +37,7 @@
 
 // Local packages
 import org.mulgara.query.*;
+import org.mulgara.query.filter.Filter;
 import org.mulgara.resolver.spi.*;
 
 /**
@@ -741,6 +742,21 @@
 
 
   /**
+   * Filter a Tuples according to a {@link org.mulgara.query.filter.Filter} test.
+   * @param tuples The Tuples to be filtered.
+   * @param filter The Filter to apply to the tuples.
+   * @param context The context in which the Filter is to be resolved. This can go beyond
+   *        what has already been determined for the tuples parameter.
+   * @return A new Tuples which is a subset of the provided Tuples.
+   * @throws IllegalArgumentException If tuples is <code>null</code>
+   */
+  public static Tuples filter(Tuples tuples, Filter filter, QueryEvaluationContext context) {
+    // The incoming context needs to be updated for the tuples, so that clones are not inadvertantly used
+    return new FilteredTuples(tuples, filter, context);
+  }
+
+
+  /**
    * Sort into default order, based on the columns and local node numbers.
    *
    * @param tuples the tuples to sort




More information about the Mulgara-svn mailing list