runtime functions implemented for op:node-before op:node-after
authorShivani Mall <small002@ucr.edu>
Thu, 18 Jun 2015 00:39:36 +0000 (17:39 -0700)
committerShivani Mall <small002@ucr.edu>
Thu, 18 Jun 2015 00:39:36 +0000 (17:39 -0700)
12 files changed:
vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/nodes/AbstractNodePointable.java [new file with mode: 0644]
vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/nodes/AttributeNodePointable.java
vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/nodes/DocumentNodePointable.java
vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/nodes/ElementNodePointable.java
vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/nodes/PINodePointable.java
vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/nodes/TextOrCommentNodePointable.java
vxquery-core/src/main/java/org/apache/vxquery/functions/builtin-operators.xml
vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/node/AbstractNodePositionalCheckEvaluator.java [new file with mode: 0644]
vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/node/OpNodeAfterEvaluator.java [new file with mode: 0644]
vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/node/OpNodeAfterEvaluatorFactory.java [new file with mode: 0644]
vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/node/OpNodeBeforeEvaluator.java [new file with mode: 0644]
vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/node/OpNodeBeforeEvaluatorFactory.java [new file with mode: 0644]

diff --git a/vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/nodes/AbstractNodePointable.java b/vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/nodes/AbstractNodePointable.java
new file mode 100644 (file)
index 0000000..05a2b6d
--- /dev/null
@@ -0,0 +1,12 @@
+package org.apache.vxquery.datamodel.accessors.nodes;
+
+import edu.uci.ics.hyracks.data.std.api.AbstractPointable;
+import edu.uci.ics.hyracks.data.std.primitive.IntegerPointable;
+
+public abstract class AbstractNodePointable extends AbstractPointable {
+     public int getLocalNodeId(NodeTreePointable nodeTree) {
+        return nodeTree.nodeIdExists() ? IntegerPointable.getInteger(bytes, getLocalNodeIdOffset(nodeTree)) : -1;
+    }
+
+    abstract protected int getLocalNodeIdOffset(NodeTreePointable nodeTree);
+}
index 22d651e..030222b 100644 (file)
@@ -19,10 +19,8 @@ package org.apache.vxquery.datamodel.accessors.nodes;
 import org.apache.vxquery.datamodel.accessors.atomic.CodedQNamePointable;
 
 import edu.uci.ics.hyracks.api.dataflow.value.ITypeTraits;
-import edu.uci.ics.hyracks.data.std.api.AbstractPointable;
 import edu.uci.ics.hyracks.data.std.api.IPointable;
 import edu.uci.ics.hyracks.data.std.api.IPointableFactory;
-import edu.uci.ics.hyracks.data.std.primitive.IntegerPointable;
 import edu.uci.ics.hyracks.data.std.primitive.VoidPointable;
 
 /*
@@ -39,7 +37,7 @@ import edu.uci.ics.hyracks.data.std.primitive.VoidPointable;
  *  Integer LocalCode;
  * }
  */
-public class AttributeNodePointable extends AbstractPointable {
+public class AttributeNodePointable extends AbstractNodePointable {
     private static final int LOCAL_NODE_ID_SIZE = 4;
     public static final IPointableFactory FACTORY = new IPointableFactory() {
         private static final long serialVersionUID = 1L;
@@ -67,11 +65,7 @@ public class AttributeNodePointable extends AbstractPointable {
         }
     }
 
-    public int getLocalNodeId(NodeTreePointable nodeTree) {
-        return nodeTree.nodeIdExists() ? IntegerPointable.getInteger(bytes, getLocalNodeIdOffset(nodeTree)) : -1;
-    }
-
-    public void getValue(NodeTreePointable nodeTree, IPointable value) {
+     public void getValue(NodeTreePointable nodeTree, IPointable value) {
         value.set(bytes, getValueOffset(nodeTree), getValueSize(nodeTree));
     }
 
@@ -91,7 +85,7 @@ public class AttributeNodePointable extends AbstractPointable {
         return nodeTree.typeExists() ? CodedQNamePointable.SIZE : 0;
     }
 
-    private int getLocalNodeIdOffset(NodeTreePointable nodeTree) {
+    protected int getLocalNodeIdOffset(NodeTreePointable nodeTree) {
         return getTypeOffset() + getTypeSize(nodeTree);
     }
 
index 7c201bd..c3a2749 100644 (file)
@@ -19,10 +19,8 @@ package org.apache.vxquery.datamodel.accessors.nodes;
 import org.apache.vxquery.datamodel.accessors.SequencePointable;
 
 import edu.uci.ics.hyracks.api.dataflow.value.ITypeTraits;
-import edu.uci.ics.hyracks.data.std.api.AbstractPointable;
 import edu.uci.ics.hyracks.data.std.api.IPointable;
 import edu.uci.ics.hyracks.data.std.api.IPointableFactory;
-import edu.uci.ics.hyracks.data.std.primitive.IntegerPointable;
 import edu.uci.ics.hyracks.data.std.primitive.VoidPointable;
 
 /*
@@ -31,7 +29,7 @@ import edu.uci.ics.hyracks.data.std.primitive.VoidPointable;
  *  Sequence content;
  * }
  */
-public class DocumentNodePointable extends AbstractPointable {
+public class DocumentNodePointable extends AbstractNodePointable {
     private static final int LOCAL_NODE_ID_SIZE = 4;
     public static final IPointableFactory FACTORY = new IPointableFactory() {
         private static final long serialVersionUID = 1L;
@@ -47,15 +45,11 @@ public class DocumentNodePointable extends AbstractPointable {
         }
     };
 
-    public int getLocalNodeId(NodeTreePointable nodeTree) {
-        return nodeTree.nodeIdExists() ? IntegerPointable.getInteger(bytes, getLocalNodeIdOffset()) : -1;
-    }
-
     public void getContent(NodeTreePointable nodeTree, SequencePointable content) {
         content.set(bytes, getContentOffset(nodeTree), getContentSize(nodeTree));
     }
 
-    private int getLocalNodeIdOffset() {
+    protected int getLocalNodeIdOffset(NodeTreePointable nodeTree) {
         return start;
     }
 
@@ -64,10 +58,11 @@ public class DocumentNodePointable extends AbstractPointable {
     }
 
     private int getContentOffset(NodeTreePointable nodeTree) {
-        return getLocalNodeIdOffset() + getLocalNodeIdSize(nodeTree);
+        return getLocalNodeIdOffset(nodeTree) + getLocalNodeIdSize(nodeTree);
     }
 
     private int getContentSize(NodeTreePointable nodeTree) {
         return length - (getContentOffset(nodeTree) - start);
     }
+
 }
\ No newline at end of file
index f2ba29e..faadd33 100644 (file)
@@ -20,7 +20,6 @@ import org.apache.vxquery.datamodel.accessors.SequencePointable;
 import org.apache.vxquery.datamodel.accessors.atomic.CodedQNamePointable;
 
 import edu.uci.ics.hyracks.api.dataflow.value.ITypeTraits;
-import edu.uci.ics.hyracks.data.std.api.AbstractPointable;
 import edu.uci.ics.hyracks.data.std.api.IPointable;
 import edu.uci.ics.hyracks.data.std.api.IPointableFactory;
 import edu.uci.ics.hyracks.data.std.primitive.BytePointable;
@@ -57,7 +56,7 @@ import edu.uci.ics.hyracks.data.std.primitive.VoidPointable;
  *  NamePtr[2][chunkSizeInBytes / (sizeof(NamePtr) * 2)] namespaces;
  * }
  */
-public class ElementNodePointable extends AbstractPointable {
+public class ElementNodePointable extends AbstractNodePointable {
     public static final byte NS_CHUNK_EXISTS_MASK = (0x1 << 0);
     public static final byte ATTRIBUTES_CHUNK_EXISTS_MASK = (0x1 << 1);
     public static final byte CHILDREN_CHUNK_EXISTS_MASK = (0x1 << 2);
@@ -170,7 +169,7 @@ public class ElementNodePointable extends AbstractPointable {
         return nodeTree.typeExists() ? CodedQNamePointable.SIZE : 0;
     }
 
-    private int getLocalNodeIdOffset(NodeTreePointable nodeTree) {
+    protected int getLocalNodeIdOffset(NodeTreePointable nodeTree) {
         return getTypeOffset() + getTypeSize(nodeTree);
     }
 
index b293841..2318ba6 100644 (file)
 package org.apache.vxquery.datamodel.accessors.nodes;
 
 import edu.uci.ics.hyracks.api.dataflow.value.ITypeTraits;
-import edu.uci.ics.hyracks.data.std.api.AbstractPointable;
 import edu.uci.ics.hyracks.data.std.api.IPointable;
 import edu.uci.ics.hyracks.data.std.api.IPointableFactory;
-import edu.uci.ics.hyracks.data.std.primitive.IntegerPointable;
 import edu.uci.ics.hyracks.data.std.primitive.UTF8StringPointable;
 import edu.uci.ics.hyracks.data.std.primitive.VoidPointable;
 
@@ -31,7 +29,7 @@ import edu.uci.ics.hyracks.data.std.primitive.VoidPointable;
  *  String content;
  * }
  */
-public class PINodePointable extends AbstractPointable {
+public class PINodePointable extends AbstractNodePointable {
     private static final int LOCAL_NODE_ID_SIZE = 4;
     public static final IPointableFactory FACTORY = new IPointableFactory() {
         private static final long serialVersionUID = 1L;
@@ -47,10 +45,6 @@ public class PINodePointable extends AbstractPointable {
         }
     };
 
-    public int getLocalNodeId(NodeTreePointable nodeTree) {
-        return nodeTree.nodeIdExists() ? IntegerPointable.getInteger(bytes, getLocalNodeIdOffset()) : -1;
-    }
-
     public void getTarget(NodeTreePointable nodeTree, IPointable target) {
         target.set(bytes, getTargetOffset(nodeTree), getTargetSize(nodeTree));
     }
@@ -59,7 +53,7 @@ public class PINodePointable extends AbstractPointable {
         content.set(bytes, getContentOffset(nodeTree), getContentSize(nodeTree));
     }
 
-    private int getLocalNodeIdOffset() {
+    protected int getLocalNodeIdOffset(NodeTreePointable nodeTree) {
         return start;
     }
 
@@ -68,7 +62,7 @@ public class PINodePointable extends AbstractPointable {
     }
 
     private int getTargetOffset(NodeTreePointable nodeTree) {
-        return getLocalNodeIdOffset() + getLocalNodeIdSize(nodeTree);
+        return getLocalNodeIdOffset(nodeTree) + getLocalNodeIdSize(nodeTree);
     }
 
     private int getTargetSize(NodeTreePointable nodeTree) {
index e4a9bed..2ab2555 100644 (file)
 package org.apache.vxquery.datamodel.accessors.nodes;
 
 import edu.uci.ics.hyracks.api.dataflow.value.ITypeTraits;
-import edu.uci.ics.hyracks.data.std.api.AbstractPointable;
 import edu.uci.ics.hyracks.data.std.api.IPointable;
 import edu.uci.ics.hyracks.data.std.api.IPointableFactory;
-import edu.uci.ics.hyracks.data.std.primitive.IntegerPointable;
 import edu.uci.ics.hyracks.data.std.primitive.VoidPointable;
 
 /*
@@ -29,7 +27,7 @@ import edu.uci.ics.hyracks.data.std.primitive.VoidPointable;
  *  UTF8String value;
  * }
  */
-public class TextOrCommentNodePointable extends AbstractPointable {
+public class TextOrCommentNodePointable extends AbstractNodePointable {
     private static final int LOCAL_NODE_ID_SIZE = 4;
     public static final IPointableFactory FACTORY = new IPointableFactory() {
         private static final long serialVersionUID = 1L;
@@ -45,15 +43,11 @@ public class TextOrCommentNodePointable extends AbstractPointable {
         }
     };
 
-    public int getLocalNodeId(NodeTreePointable nodeTree) {
-        return nodeTree.nodeIdExists() ? IntegerPointable.getInteger(bytes, getLocalNodeIdOffset()) : -1;
-    }
-
     public void getValue(NodeTreePointable nodeTree, IPointable value) {
         value.set(bytes, getValueOffset(nodeTree), getValueSize(nodeTree));
     }
 
-    private int getLocalNodeIdOffset() {
+    protected int getLocalNodeIdOffset(NodeTreePointable nodeTree) {
         return start;
     }
 
@@ -62,10 +56,11 @@ public class TextOrCommentNodePointable extends AbstractPointable {
     }
 
     private int getValueOffset(NodeTreePointable nodeTree) {
-        return getLocalNodeIdOffset() + getLocalNodeIdSize(nodeTree);
+        return getLocalNodeIdOffset(nodeTree) + getLocalNodeIdSize(nodeTree);
     }
 
     private int getValueSize(NodeTreePointable nodeTree) {
         return length - (getValueOffset(nodeTree) - start);
     }
+
 }
\ No newline at end of file
index 5892c48..c0f5968 100644 (file)
 
     <!-- op:is-same-node($parameter1 as node(), $parameter2 as node()) as xs:boolean -->
     <operator name="op:is-same-node">
-        <param name="parameter1" type="node()?"/>
-        <param name="parameter2" type="node()?"/>
+        <param name="parameter1" type="node()"/>
+        <param name="parameter2" type="node()"/>
         <return type="xs:boolean"/>
-    </operator>
+     </operator>
 
     <!-- op:multiply-dayTimeDuration( $arg1 as xs:dayTimeDuration, $arg2 as xs:double)  as xs:dayTimeDuration -->
     <operator name="op:multiply-dayTimeDuration">
 
     <!-- op:node-after($parameter1  as node(), $parameter2 as node())  as xs:boolean -->
     <operator name="op:node-after">
-        <param name="parameter1" type="node()?"/>
-        <param name="parameter2" type="node()?"/>
+        <param name="parameter1" type="node()"/>
+        <param name="parameter2" type="node()"/>
+        <runtime type="scalar" class="org.apache.vxquery.runtime.functions.node.OpNodeAfterEvaluatorFactory"/>
         <return type="xs:boolean"/>
     </operator>
 
     <!-- op:node-before($parameter1  as node(), $parameter2 as node())  as xs:boolean -->
     <operator name="op:node-before">
-        <param name="parameter1" type="node()?"/>
-        <param name="parameter2" type="node()?"/>
+        <param name="parameter1" type="node()"/>
+        <param name="parameter2" type="node()"/>
         <return type="xs:boolean"/>
-    </operator>
+        <runtime type="scalar" class="org.apache.vxquery.runtime.functions.node.OpNodeBeforeEvaluatorFactory"/>
+     </operator>
 
     <!-- op:NOTATION-equal($arg1  as xs:NOTATION, $arg2 as xs:NOTATION)  as xs:boolean -->
     <operator name="op:NOTATION-equal">
diff --git a/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/node/AbstractNodePositionalCheckEvaluator.java b/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/node/AbstractNodePositionalCheckEvaluator.java
new file mode 100644 (file)
index 0000000..56cb3fa
--- /dev/null
@@ -0,0 +1,50 @@
+package org.apache.vxquery.runtime.functions.node;
+
+import org.apache.vxquery.datamodel.accessors.TaggedValuePointable;
+import org.apache.vxquery.datamodel.accessors.TypedPointables;
+import org.apache.vxquery.datamodel.accessors.nodes.NodeTreePointable;
+import org.apache.vxquery.datamodel.values.ValueTag;
+import org.apache.vxquery.datamodel.values.XDMConstants;
+import org.apache.vxquery.exceptions.ErrorCode;
+import org.apache.vxquery.exceptions.SystemException;
+import org.apache.vxquery.runtime.functions.base.AbstractTaggedValueArgumentScalarEvaluator;
+import org.apache.vxquery.runtime.functions.util.FunctionHelper;
+
+import edu.uci.ics.hyracks.algebricks.runtime.base.IScalarEvaluator;
+import edu.uci.ics.hyracks.data.std.api.IPointable;
+
+public abstract class AbstractNodePositionalCheckEvaluator extends AbstractTaggedValueArgumentScalarEvaluator {
+
+    public AbstractNodePositionalCheckEvaluator(IScalarEvaluator[] args) {
+        super(args);
+    }
+
+    private final NodeTreePointable ntp1 = (NodeTreePointable) NodeTreePointable.FACTORY.createPointable();
+    private final NodeTreePointable ntp2 = (NodeTreePointable) NodeTreePointable.FACTORY.createPointable();
+    private final TypedPointables tp = new TypedPointables();
+
+    @Override
+    protected void evaluate(TaggedValuePointable[] args, IPointable result) throws SystemException {
+
+        parameterTypeCheck(args[0], ntp1);
+        parameterTypeCheck(args[1], ntp2);
+
+        if (nodeCompare(FunctionHelper.getLocalNodeId(args[0], tp), FunctionHelper.getLocalNodeId(args[1], tp))) {
+            XDMConstants.setTrue(result);
+        } else {
+            XDMConstants.setFalse(result);
+        }
+    }
+
+    //node passed in from argument
+    protected void parameterTypeCheck(TaggedValuePointable node, NodeTreePointable ntp) throws SystemException {
+        if (node.getTag() == ValueTag.NODE_TREE_TAG) {
+            node.getValue(ntp);
+            return;
+        }
+        throw new SystemException(ErrorCode.FORG0006);
+    }
+
+    abstract protected boolean nodeCompare(int firstId, int secondId);
+
+}
diff --git a/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/node/OpNodeAfterEvaluator.java b/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/node/OpNodeAfterEvaluator.java
new file mode 100644 (file)
index 0000000..acc2714
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * 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.vxquery.runtime.functions.node;
+
+import edu.uci.ics.hyracks.algebricks.runtime.base.IScalarEvaluator;
+
+public class OpNodeAfterEvaluator extends AbstractNodePositionalCheckEvaluator {
+
+    public OpNodeAfterEvaluator(IScalarEvaluator[] args) {
+        super(args);
+    }
+
+    @Override
+    protected boolean nodeCompare(int firstId, int secondId) {
+        return (firstId > secondId);
+    }
+
+}
diff --git a/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/node/OpNodeAfterEvaluatorFactory.java b/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/node/OpNodeAfterEvaluatorFactory.java
new file mode 100644 (file)
index 0000000..71ada1c
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * 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.vxquery.runtime.functions.node;
+
+import org.apache.vxquery.runtime.functions.base.AbstractTaggedValueArgumentScalarEvaluatorFactory;
+
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.runtime.base.IScalarEvaluator;
+import edu.uci.ics.hyracks.algebricks.runtime.base.IScalarEvaluatorFactory;
+import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
+
+public class OpNodeAfterEvaluatorFactory extends AbstractTaggedValueArgumentScalarEvaluatorFactory {
+
+    public OpNodeAfterEvaluatorFactory(IScalarEvaluatorFactory[] args) {
+        super(args);
+    }
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    protected IScalarEvaluator createEvaluator(IHyracksTaskContext ctx, IScalarEvaluator[] args)
+            throws AlgebricksException {
+        return new OpNodeAfterEvaluator(args);
+    }
+
+}
diff --git a/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/node/OpNodeBeforeEvaluator.java b/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/node/OpNodeBeforeEvaluator.java
new file mode 100644 (file)
index 0000000..ce9e496
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * 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.vxquery.runtime.functions.node;
+
+import edu.uci.ics.hyracks.algebricks.runtime.base.IScalarEvaluator;
+
+public class OpNodeBeforeEvaluator extends AbstractNodePositionalCheckEvaluator {
+
+    public OpNodeBeforeEvaluator(IScalarEvaluator[] args) {
+        super(args);
+    }
+
+    @Override
+    protected boolean nodeCompare(int firstId, int secondId) {
+        return (firstId < secondId);
+    }
+
+}
diff --git a/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/node/OpNodeBeforeEvaluatorFactory.java b/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/node/OpNodeBeforeEvaluatorFactory.java
new file mode 100644 (file)
index 0000000..5791cb4
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * 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.vxquery.runtime.functions.node;
+
+import org.apache.vxquery.runtime.functions.base.AbstractTaggedValueArgumentScalarEvaluatorFactory;
+
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.runtime.base.IScalarEvaluator;
+import edu.uci.ics.hyracks.algebricks.runtime.base.IScalarEvaluatorFactory;
+import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
+
+public class OpNodeBeforeEvaluatorFactory extends AbstractTaggedValueArgumentScalarEvaluatorFactory {
+
+    private static final long serialVersionUID = 1L;
+
+    public OpNodeBeforeEvaluatorFactory(IScalarEvaluatorFactory[] args) {
+        super(args);
+    }
+
+    @Override
+    protected IScalarEvaluator createEvaluator(IHyracksTaskContext ctx, IScalarEvaluator[] args)
+            throws AlgebricksException {
+        return new OpNodeBeforeEvaluator(args);
+    }
+
+}