Repository: jena
Updated Branches:
  refs/heads/master 15d839b4e -> 76fd427bc


JENA-1339: Add PFuncListAndList, PFuncListAndSimple.

Tidy up javadoc.

Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/76fd427b
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/76fd427b
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/76fd427b

Branch: refs/heads/master
Commit: 76fd427bc1e4ba24958a2f1add34ad1ec839d188
Parents: 15d839b
Author: Andy Seaborne <[email protected]>
Authored: Mon May 22 11:35:46 2017 +0100
Committer: Andy Seaborne <[email protected]>
Committed: Mon May 22 11:35:46 2017 +0100

----------------------------------------------------------------------
 .../jena/sparql/pfunction/PFuncListAndList.java | 51 +++++++++++++++++
 .../sparql/pfunction/PFuncListAndSimple.java    | 59 ++++++++++++++++++++
 .../jena/sparql/pfunction/PFuncSimple.java      |  3 +-
 .../sparql/pfunction/PFuncSimpleAndList.java    |  4 +-
 4 files changed, 114 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/76fd427b/jena-arq/src/main/java/org/apache/jena/sparql/pfunction/PFuncListAndList.java
----------------------------------------------------------------------
diff --git 
a/jena-arq/src/main/java/org/apache/jena/sparql/pfunction/PFuncListAndList.java 
b/jena-arq/src/main/java/org/apache/jena/sparql/pfunction/PFuncListAndList.java
new file mode 100644
index 0000000..0c39ca3
--- /dev/null
+++ 
b/jena-arq/src/main/java/org/apache/jena/sparql/pfunction/PFuncListAndList.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jena.sparql.pfunction;
+
+import org.apache.jena.graph.Node ;
+import org.apache.jena.sparql.engine.ExecutionContext ;
+import org.apache.jena.sparql.engine.QueryIterator ;
+import org.apache.jena.sparql.engine.binding.Binding ;
+
+/**
+ * The case of:
+ * <ul>
+ * <li>subject is a list</li>
+ * <li>object is a list</li>
+ * <li>call the implementation with one binding at a time</li>
+ * </ul>
+ */
+public abstract class PFuncListAndList extends PropertyFunctionEval {
+
+    protected PFuncListAndList() {
+        super(PropFuncArgType.PF_ARG_LIST, PropFuncArgType.PF_ARG_LIST);
+    }
+
+    /** 
+     * @param binding   Current solution from previous query stage 
+     * @param subject   List in subject slot, after substitution of any bound 
variables in this binding
+     * @param predicate This predicate
+     * @param object    List in object slot, after substitution of any bound 
variables in this binding
+     * @param execCxt   Execution context
+     * @return          QueryIterator
+     */
+    @Override
+    public abstract QueryIterator execEvaluated(Binding binding, 
+                                                PropFuncArg subject, Node 
predicate, PropFuncArg object,
+                                                ExecutionContext execCxt) ;
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/76fd427b/jena-arq/src/main/java/org/apache/jena/sparql/pfunction/PFuncListAndSimple.java
----------------------------------------------------------------------
diff --git 
a/jena-arq/src/main/java/org/apache/jena/sparql/pfunction/PFuncListAndSimple.java
 
b/jena-arq/src/main/java/org/apache/jena/sparql/pfunction/PFuncListAndSimple.java
new file mode 100644
index 0000000..cfe95d4
--- /dev/null
+++ 
b/jena-arq/src/main/java/org/apache/jena/sparql/pfunction/PFuncListAndSimple.java
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.sparql.pfunction;
+
+import org.apache.jena.graph.Node ;
+import org.apache.jena.sparql.engine.ExecutionContext ;
+import org.apache.jena.sparql.engine.QueryIterator ;
+import org.apache.jena.sparql.engine.binding.Binding ;
+
+/** The case of:
+ *  <ul> 
+ *  <li>subject is a list</li>
+ *  <li>object is a node, not a list</li>
+ *  <li>call the implementation with one binding at a time</li>
+ *  </ul>
+ */
+
+public abstract
+class PFuncListAndSimple extends PropertyFunctionEval
+{
+    protected PFuncListAndSimple()
+    {
+        super(PropFuncArgType.PF_ARG_SINGLE, PropFuncArgType.PF_ARG_LIST) ;
+    }
+
+    @Override
+    public QueryIterator execEvaluated(Binding binding, PropFuncArg 
argSubject, Node predicate, PropFuncArg argObject, ExecutionContext execCxt)
+    {
+        return execEvaluated(binding, argSubject, predicate, 
argObject.getArg(), execCxt) ;
+    }
+
+    /** 
+     * @param binding   Current solution from previous query stage 
+     * @param subject   List in subject slot, after substitution of any bound 
variables in this binding
+     * @param predicate This predicate
+     * @param object    Node in object slot, after substitution if a bound 
variable in this binding
+     * @param execCxt   Execution context
+     * @return          QueryIterator
+     */
+    public abstract QueryIterator execEvaluated(Binding binding, 
+                                                PropFuncArg subject, Node 
predicate, Node object,
+                                                ExecutionContext execCxt) ;
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/76fd427b/jena-arq/src/main/java/org/apache/jena/sparql/pfunction/PFuncSimple.java
----------------------------------------------------------------------
diff --git 
a/jena-arq/src/main/java/org/apache/jena/sparql/pfunction/PFuncSimple.java 
b/jena-arq/src/main/java/org/apache/jena/sparql/pfunction/PFuncSimple.java
index 0a84b97..4076be6 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/pfunction/PFuncSimple.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/pfunction/PFuncSimple.java
@@ -28,7 +28,8 @@ import org.apache.jena.sparql.engine.binding.Binding ;
  *  <li>arguments are not lists</li>
  *  <li>attempt to put values in for any bound variables</li>
  *  <li>call the implementation with one binding at a time</li>
- *  </ul> */
+ *  </ul>
+ */
 
 public abstract
 class PFuncSimple extends PropertyFunctionEval

http://git-wip-us.apache.org/repos/asf/jena/blob/76fd427b/jena-arq/src/main/java/org/apache/jena/sparql/pfunction/PFuncSimpleAndList.java
----------------------------------------------------------------------
diff --git 
a/jena-arq/src/main/java/org/apache/jena/sparql/pfunction/PFuncSimpleAndList.java
 
b/jena-arq/src/main/java/org/apache/jena/sparql/pfunction/PFuncSimpleAndList.java
index 57d65f9..1c24b76 100644
--- 
a/jena-arq/src/main/java/org/apache/jena/sparql/pfunction/PFuncSimpleAndList.java
+++ 
b/jena-arq/src/main/java/org/apache/jena/sparql/pfunction/PFuncSimpleAndList.java
@@ -25,7 +25,7 @@ import org.apache.jena.sparql.engine.binding.Binding ;
 
 /** Common, simple case:
  *  <ul> 
- *  <li>subject arguments is not a list</li>
+ *  <li>subject argument is not a list</li>
  *  <li>object is a list</li>
  *  <li>call the implementation with one binding at a time</li>
  *  </ul> */
@@ -48,7 +48,7 @@ class PFuncSimpleAndList extends PropertyFunctionEval
      * @param binding   Current solution from previous query stage 
      * @param subject   Node in subject slot, after substitution if a bound 
variable in this binding
      * @param predicate This predicate
-     * @param object    List in object slot, after substitution if a bound 
variable in this binding
+     * @param object    List in object slot, after substitution of any bound 
variables in this binding
      * @param execCxt   Execution context
      * @return          QueryIterator
      */

Reply via email to