You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@vxquery.apache.org by pr...@apache.org on 2013/02/21 23:06:10 UTC

svn commit: r1448824 - in /incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies: ./ documentorder/ uniquenodes/

Author: prestonc
Date: Thu Feb 21 22:06:10 2013
New Revision: 1448824

URL: http://svn.apache.org/r1448824
Log:
Added the propagation policies for DocumentOrder and UniqueNodes.

Added:
    incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/
    incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/ConstantPropertyPropagationPolicy.java   (with props)
    incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/IPropertyPropagationPolicy.java   (with props)
    incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/InputPropertyPropagationPolicy.java   (with props)
    incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/documentorder/
    incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/documentorder/DocumentOrder.java   (with props)
    incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/documentorder/DocumentOrderNOPropagationPolicy.java   (with props)
    incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/documentorder/DocumentOrderYESPropagationPolicy.java   (with props)
    incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/uniquenodes/
    incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/uniquenodes/UniqueNodes.java   (with props)
    incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/uniquenodes/UniqueNodesNOPropagationPolicy.java   (with props)
    incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/uniquenodes/UniqueNodesYESPropagationPolicy.java   (with props)

Added: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/ConstantPropertyPropagationPolicy.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/ConstantPropertyPropagationPolicy.java?rev=1448824&view=auto
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/ConstantPropertyPropagationPolicy.java (added)
+++ incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/ConstantPropertyPropagationPolicy.java Thu Feb 21 22:06:10 2013
@@ -0,0 +1,37 @@
+/*
+* 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.compiler.rewriter.rules.propagationpolicies;
+
+import java.util.List;
+
+public class ConstantPropertyPropagationPolicy<P> implements IPropertyPropagationPolicy<P>{
+    
+    private final P property;
+    
+    public ConstantPropertyPropagationPolicy(P property) {
+        this.property = property;
+    }
+    
+    /**
+     * The argument does not change the result of this property.
+     */
+    @Override
+    public P propagate(List<P> argProperties) {
+        return property;
+    }
+
+}
\ No newline at end of file

Propchange: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/ConstantPropertyPropagationPolicy.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/IPropertyPropagationPolicy.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/IPropertyPropagationPolicy.java?rev=1448824&view=auto
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/IPropertyPropagationPolicy.java (added)
+++ incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/IPropertyPropagationPolicy.java Thu Feb 21 22:06:10 2013
@@ -0,0 +1,25 @@
+/*
+* 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.compiler.rewriter.rules.propagationpolicies;
+
+import java.util.List;
+
+public interface IPropertyPropagationPolicy<P> {
+    
+    public P propagate(List<P> argProperties);
+
+}
\ No newline at end of file

Propchange: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/IPropertyPropagationPolicy.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/InputPropertyPropagationPolicy.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/InputPropertyPropagationPolicy.java?rev=1448824&view=auto
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/InputPropertyPropagationPolicy.java (added)
+++ incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/InputPropertyPropagationPolicy.java Thu Feb 21 22:06:10 2013
@@ -0,0 +1,37 @@
+/*
+* 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.compiler.rewriter.rules.propagationpolicies;
+
+import java.util.List;
+
+public class InputPropertyPropagationPolicy<P> implements IPropertyPropagationPolicy<P>{
+    
+    private final int inputIndex;
+    
+    public InputPropertyPropagationPolicy(int inputIndex) {
+        this.inputIndex = inputIndex;
+    }
+    
+    /**
+     * The property is based on a specific input argument.
+     */
+    @Override
+    public P propagate(List<P> argProperties) {
+        return argProperties.get(inputIndex);
+    }
+    
+}
\ No newline at end of file

Propchange: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/InputPropertyPropagationPolicy.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/documentorder/DocumentOrder.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/documentorder/DocumentOrder.java?rev=1448824&view=auto
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/documentorder/DocumentOrder.java (added)
+++ incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/documentorder/DocumentOrder.java Thu Feb 21 22:06:10 2013
@@ -0,0 +1,24 @@
+/*
+* 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.compiler.rewriter.rules.propagationpolicies.documentorder;
+
+public enum DocumentOrder {
+
+    YES,
+    NO;
+
+}
\ No newline at end of file

Propchange: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/documentorder/DocumentOrder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/documentorder/DocumentOrderNOPropagationPolicy.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/documentorder/DocumentOrderNOPropagationPolicy.java?rev=1448824&view=auto
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/documentorder/DocumentOrderNOPropagationPolicy.java (added)
+++ incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/documentorder/DocumentOrderNOPropagationPolicy.java Thu Feb 21 22:06:10 2013
@@ -0,0 +1,27 @@
+/*
+* 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.compiler.rewriter.rules.propagationpolicies.documentorder;
+
+import org.apache.vxquery.compiler.rewriter.rules.propagationpolicies.ConstantPropertyPropagationPolicy;
+
+public class DocumentOrderNOPropagationPolicy extends ConstantPropertyPropagationPolicy<DocumentOrder> {
+
+    public DocumentOrderNOPropagationPolicy() {
+        super(DocumentOrder.NO);
+    }
+
+}
\ No newline at end of file

Propchange: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/documentorder/DocumentOrderNOPropagationPolicy.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/documentorder/DocumentOrderYESPropagationPolicy.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/documentorder/DocumentOrderYESPropagationPolicy.java?rev=1448824&view=auto
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/documentorder/DocumentOrderYESPropagationPolicy.java (added)
+++ incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/documentorder/DocumentOrderYESPropagationPolicy.java Thu Feb 21 22:06:10 2013
@@ -0,0 +1,27 @@
+/*
+* 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.compiler.rewriter.rules.propagationpolicies.documentorder;
+
+import org.apache.vxquery.compiler.rewriter.rules.propagationpolicies.ConstantPropertyPropagationPolicy;
+
+public class DocumentOrderYESPropagationPolicy extends ConstantPropertyPropagationPolicy<DocumentOrder> {
+
+    public DocumentOrderYESPropagationPolicy() {
+        super(DocumentOrder.YES);
+    }
+
+}
\ No newline at end of file

Propchange: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/documentorder/DocumentOrderYESPropagationPolicy.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/uniquenodes/UniqueNodes.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/uniquenodes/UniqueNodes.java?rev=1448824&view=auto
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/uniquenodes/UniqueNodes.java (added)
+++ incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/uniquenodes/UniqueNodes.java Thu Feb 21 22:06:10 2013
@@ -0,0 +1,24 @@
+/*
+* 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.compiler.rewriter.rules.propagationpolicies.uniquenodes;
+
+public enum UniqueNodes {
+
+    YES,
+    NO;
+
+}
\ No newline at end of file

Propchange: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/uniquenodes/UniqueNodes.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/uniquenodes/UniqueNodesNOPropagationPolicy.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/uniquenodes/UniqueNodesNOPropagationPolicy.java?rev=1448824&view=auto
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/uniquenodes/UniqueNodesNOPropagationPolicy.java (added)
+++ incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/uniquenodes/UniqueNodesNOPropagationPolicy.java Thu Feb 21 22:06:10 2013
@@ -0,0 +1,27 @@
+/*
+* 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.compiler.rewriter.rules.propagationpolicies.uniquenodes;
+
+import org.apache.vxquery.compiler.rewriter.rules.propagationpolicies.ConstantPropertyPropagationPolicy;
+
+public class UniqueNodesNOPropagationPolicy extends ConstantPropertyPropagationPolicy<UniqueNodes> {
+
+    public UniqueNodesNOPropagationPolicy() {
+        super(UniqueNodes.NO);
+    }
+
+}
\ No newline at end of file

Propchange: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/uniquenodes/UniqueNodesNOPropagationPolicy.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/uniquenodes/UniqueNodesYESPropagationPolicy.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/uniquenodes/UniqueNodesYESPropagationPolicy.java?rev=1448824&view=auto
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/uniquenodes/UniqueNodesYESPropagationPolicy.java (added)
+++ incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/uniquenodes/UniqueNodesYESPropagationPolicy.java Thu Feb 21 22:06:10 2013
@@ -0,0 +1,27 @@
+/*
+* 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.compiler.rewriter.rules.propagationpolicies.uniquenodes;
+
+import org.apache.vxquery.compiler.rewriter.rules.propagationpolicies.ConstantPropertyPropagationPolicy;
+
+public class UniqueNodesYESPropagationPolicy extends ConstantPropertyPropagationPolicy<UniqueNodes> {
+
+    public UniqueNodesYESPropagationPolicy() {
+        super(UniqueNodes.YES);
+    }
+
+}
\ No newline at end of file

Propchange: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/propagationpolicies/uniquenodes/UniqueNodesYESPropagationPolicy.java
------------------------------------------------------------------------------
    svn:eol-style = native