sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tom...@apache.org
Subject svn commit: r1658434 - in /sling/trunk/contrib/extensions/sling-query: ./ src/main/java/org/apache/sling/query/ src/main/java/org/apache/sling/query/api/ src/main/java/org/apache/sling/query/api/function/ src/main/java/org/apache/sling/query/api/intern...
Date Mon, 09 Feb 2015 15:19:01 GMT
Author: tomekr
Date: Mon Feb  9 15:19:00 2015
New Revision: 1658434

URL: http://svn.apache.org/r1658434
Log:
SLING-4370 Properly version packages exported by Sling Query

Added:
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/internal/
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/internal/ElementToIteratorFunction.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/internal/Function.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/internal/IteratorToIteratorFunction.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/internal/Option.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/package-info.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/package-info.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/util/
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/util/IteratorUtils.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/util/LazyList.java
Removed:
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/IteratorUtils.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/LazyList.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/Function.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/function/
Modified:
    sling/trunk/contrib/extensions/sling-query/pom.xml
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/AbstractQuery.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/SlingQuery.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/Predicate.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/SearchStrategy.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/TreeProvider.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/AddFunction.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/ChildrenFunction.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/ClosestFunction.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/CompositeFunction.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/DescendantFunction.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/EvenFunction.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/FilterFunction.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/FindFunction.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/HasFunction.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/IdentityFunction.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/IteratorToIteratorFunctionWrapper.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/LastFunction.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/NextFunction.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/NotFunction.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/ParentFunction.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/ParentsFunction.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/PrevFunction.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/SiblingsFunction.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/SliceFunction.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/UniqueFunction.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/AlternativeIterator.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/ArgumentResettingIterator.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/DescendantsIterator.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/EmptyElementFilter.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/ExpandingIterator.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/FilteringIterator.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/LastIterator.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/OptionDecoratingIterator.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/OptionStrippingIterator.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/ReverseIterator.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/SiblingsIterator.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/SliceIterator.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/SuppIterator.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/UniqueIterator.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/predicate/IterableContainsPredicate.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/selector/FunctionType.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/selector/HierarchyOperator.java
    sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/selector/SelectorFunction.java
    sling/trunk/contrib/extensions/sling-query/src/test/java/org/apache/sling/query/TestUtils.java
    sling/trunk/contrib/extensions/sling-query/src/test/java/org/apache/sling/query/iterator/ReverseTest.java
    sling/trunk/contrib/extensions/sling-query/src/test/java/org/apache/sling/query/iterator/SuppTest.java

Modified: sling/trunk/contrib/extensions/sling-query/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/pom.xml?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/pom.xml (original)
+++ sling/trunk/contrib/extensions/sling-query/pom.xml Mon Feb  9 15:19:00 2015
@@ -27,7 +27,7 @@
 
     <modelVersion>4.0.0</modelVersion>
     <artifactId>org.apache.sling.query</artifactId>
-    <version>2.0.1-SNAPSHOT</version>
+    <version>3.0.0-SNAPSHOT</version>
     <packaging>bundle</packaging>
 
     <name>Apache Sling Query</name>

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/AbstractQuery.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/AbstractQuery.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/AbstractQuery.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/AbstractQuery.java Mon Feb  9 15:19:00 2015
@@ -24,12 +24,12 @@ import java.util.Arrays;
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.sling.query.api.Function;
 import org.apache.sling.query.api.Predicate;
 import org.apache.sling.query.api.SearchStrategy;
 import org.apache.sling.query.api.TreeProvider;
-import org.apache.sling.query.api.function.IteratorToIteratorFunction;
-import org.apache.sling.query.api.function.Option;
+import org.apache.sling.query.api.internal.Function;
+import org.apache.sling.query.api.internal.IteratorToIteratorFunction;
+import org.apache.sling.query.api.internal.Option;
 import org.apache.sling.query.function.AddFunction;
 import org.apache.sling.query.function.ChildrenFunction;
 import org.apache.sling.query.function.ClosestFunction;
@@ -54,7 +54,11 @@ import org.apache.sling.query.iterator.O
 import org.apache.sling.query.predicate.IterableContainsPredicate;
 import org.apache.sling.query.predicate.RejectingPredicate;
 import org.apache.sling.query.selector.SelectorFunction;
+import org.apache.sling.query.util.LazyList;
 
+import aQute.bnd.annotation.ProviderType;
+
+@ProviderType
 public abstract class AbstractQuery<T, Q extends AbstractQuery<T, Q>> implements Iterable<T> {
 
 	protected final List<Function<?, ?>> functions = new ArrayList<Function<?, ?>>();

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/SlingQuery.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/SlingQuery.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/SlingQuery.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/SlingQuery.java Mon Feb  9 15:19:00 2015
@@ -28,11 +28,14 @@ import org.apache.sling.query.api.Search
 import org.apache.sling.query.iterator.AdaptToIterator;
 import org.apache.sling.query.resource.ResourceTreeProvider;
 
+import aQute.bnd.annotation.ProviderType;
+
 /**
  * SlingQuery is a Sling resource tree traversal tool inspired by the jQuery.
  * 
  * @author Tomasz Rękawek
  */
+@ProviderType
 public class SlingQuery extends AbstractQuery<Resource, SlingQuery> {
 
 	private SlingQuery(AbstractQuery<Resource, SlingQuery> original, SearchStrategy strategy) {

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/Predicate.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/Predicate.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/Predicate.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/Predicate.java Mon Feb  9 15:19:00 2015
@@ -19,12 +19,15 @@
 
 package org.apache.sling.query.api;
 
+import aQute.bnd.annotation.ConsumerType;
+
 /**
  * ResourcePredicate determine true or false value for a given T.
  * 
  * @author Tomasz Rękawek
  * 
  */
+@ConsumerType
 public interface Predicate<T> {
 	/**
 	 * Accept or reject given resource.

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/SearchStrategy.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/SearchStrategy.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/SearchStrategy.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/SearchStrategy.java Mon Feb  9 15:19:00 2015
@@ -19,6 +19,9 @@
 
 package org.apache.sling.query.api;
 
+import aQute.bnd.annotation.ProviderType;
+
+@ProviderType
 public enum SearchStrategy {
 	BFS, DFS, QUERY;
 }

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/TreeProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/TreeProvider.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/TreeProvider.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/TreeProvider.java Mon Feb  9 15:19:00 2015
@@ -25,6 +25,9 @@ import java.util.List;
 import org.apache.sling.query.selector.parser.Attribute;
 import org.apache.sling.query.selector.parser.SelectorSegment;
 
+import aQute.bnd.annotation.ConsumerType;
+
+@ConsumerType
 public interface TreeProvider<T> {
 	Iterator<T> listChildren(T parent);
 

Added: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/internal/ElementToIteratorFunction.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/internal/ElementToIteratorFunction.java?rev=1658434&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/internal/ElementToIteratorFunction.java (added)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/internal/ElementToIteratorFunction.java Mon Feb  9 15:19:00 2015
@@ -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.sling.query.api.internal;
+
+import java.util.Iterator;
+
+public interface ElementToIteratorFunction<T> extends Function<T, Iterator<T>> {
+}

Added: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/internal/Function.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/internal/Function.java?rev=1658434&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/internal/Function.java (added)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/internal/Function.java Mon Feb  9 15:19:00 2015
@@ -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.sling.query.api.internal;
+
+import aQute.bnd.annotation.ConsumerType;
+
+/**
+ * Function can transform one value into another.
+ * 
+ * @author Tomasz Rękawek
+ * 
+ * @param <F> Input type
+ * @param <T> Output type
+ */
+@ConsumerType
+public interface Function<F, T> {
+	/**
+	 * Take input F and transform it into output T.
+	 * 
+	 * @param input Input value
+	 * @return Output value
+	 */
+	T apply(F input);
+}

Added: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/internal/IteratorToIteratorFunction.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/internal/IteratorToIteratorFunction.java?rev=1658434&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/internal/IteratorToIteratorFunction.java (added)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/internal/IteratorToIteratorFunction.java Mon Feb  9 15:19:00 2015
@@ -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.sling.query.api.internal;
+
+import java.util.Iterator;
+
+public interface IteratorToIteratorFunction<T> extends Function<Iterator<Option<T>>, Iterator<Option<T>>> {
+}

Added: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/internal/Option.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/internal/Option.java?rev=1658434&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/internal/Option.java (added)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/internal/Option.java Mon Feb  9 15:19:00 2015
@@ -0,0 +1,82 @@
+/*-
+ * 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.sling.query.api.internal;
+
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+
+public class Option<T> {
+	private final T element;
+
+	private final int argumentId;
+
+	private Option(T element, int argumentId) {
+		this.element = element;
+		this.argumentId = argumentId;
+	}
+
+	public static <T> Option<T> of(T element, int argumentId) {
+		return new Option<T>(element, argumentId);
+	}
+
+	public static <T> Option<T> empty(int argumentId) {
+		return new Option<T>(null, argumentId);
+	}
+
+	public int getArgumentId() {
+		return argumentId;
+	}
+
+	public T getElement() {
+		return element;
+	}
+
+	public boolean isEmpty() {
+		return element == null;
+	}
+
+	public String toString() {
+		if (isEmpty()) {
+			return "Option[-]";
+		} else {
+			return String.format("Option[%s]", element.toString());
+		}
+	}
+
+	@Override
+	public boolean equals(Object obj) {
+		if (obj == null) {
+			return false;
+		}
+		if (obj == this) {
+			return true;
+		}
+		if (obj.getClass() != getClass()) {
+			return false;
+		}
+		Option<?> rhs = (Option<?>) obj;
+		return new EqualsBuilder().append(element, rhs.element).isEquals();
+	}
+
+	@Override
+	public int hashCode() {
+		return new HashCodeBuilder().append(element).toHashCode();
+	}
+}

Added: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/package-info.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/package-info.java?rev=1658434&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/package-info.java (added)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/api/package-info.java Mon Feb  9 15:19:00 2015
@@ -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.
+ */
+
+@Version("3.0.0")
+package org.apache.sling.query.api;
+
+import aQute.bnd.annotation.Version;
+

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/AddFunction.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/AddFunction.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/AddFunction.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/AddFunction.java Mon Feb  9 15:19:00 2015
@@ -21,8 +21,8 @@ package org.apache.sling.query.function;
 
 import java.util.Iterator;
 
-import org.apache.sling.query.api.function.IteratorToIteratorFunction;
-import org.apache.sling.query.api.function.Option;
+import org.apache.sling.query.api.internal.IteratorToIteratorFunction;
+import org.apache.sling.query.api.internal.Option;
 import org.apache.sling.query.iterator.MergingIterator;
 import org.apache.sling.query.iterator.OptionDecoratingIterator;
 

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/ChildrenFunction.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/ChildrenFunction.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/ChildrenFunction.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/ChildrenFunction.java Mon Feb  9 15:19:00 2015
@@ -22,7 +22,7 @@ package org.apache.sling.query.function;
 import java.util.Iterator;
 
 import org.apache.sling.query.api.TreeProvider;
-import org.apache.sling.query.api.function.ElementToIteratorFunction;
+import org.apache.sling.query.api.internal.ElementToIteratorFunction;
 
 public class ChildrenFunction<T> implements ElementToIteratorFunction<T> {
 

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/ClosestFunction.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/ClosestFunction.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/ClosestFunction.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/ClosestFunction.java Mon Feb  9 15:19:00 2015
@@ -21,10 +21,10 @@ package org.apache.sling.query.function;
 
 import java.util.Iterator;
 
-import org.apache.sling.query.IteratorUtils;
 import org.apache.sling.query.api.Predicate;
 import org.apache.sling.query.api.TreeProvider;
-import org.apache.sling.query.api.function.ElementToIteratorFunction;
+import org.apache.sling.query.api.internal.ElementToIteratorFunction;
+import org.apache.sling.query.util.IteratorUtils;
 
 public class ClosestFunction<T> implements ElementToIteratorFunction<T> {
 

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/CompositeFunction.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/CompositeFunction.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/CompositeFunction.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/CompositeFunction.java Mon Feb  9 15:19:00 2015
@@ -22,9 +22,9 @@ package org.apache.sling.query.function;
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.sling.query.api.Function;
-import org.apache.sling.query.api.function.IteratorToIteratorFunction;
-import org.apache.sling.query.api.function.Option;
+import org.apache.sling.query.api.internal.Function;
+import org.apache.sling.query.api.internal.IteratorToIteratorFunction;
+import org.apache.sling.query.api.internal.Option;
 
 public class CompositeFunction<T> implements IteratorToIteratorFunction<T> {
 

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/DescendantFunction.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/DescendantFunction.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/DescendantFunction.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/DescendantFunction.java Mon Feb  9 15:19:00 2015
@@ -22,8 +22,8 @@ package org.apache.sling.query.function;
 import java.util.Iterator;
 
 import org.apache.sling.query.api.TreeProvider;
-import org.apache.sling.query.api.function.IteratorToIteratorFunction;
-import org.apache.sling.query.api.function.Option;
+import org.apache.sling.query.api.internal.IteratorToIteratorFunction;
+import org.apache.sling.query.api.internal.Option;
 import org.apache.sling.query.iterator.DescendantsIterator;
 
 public class DescendantFunction<T> implements IteratorToIteratorFunction<T> {

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/EvenFunction.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/EvenFunction.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/EvenFunction.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/EvenFunction.java Mon Feb  9 15:19:00 2015
@@ -22,8 +22,8 @@ package org.apache.sling.query.function;
 import java.util.Iterator;
 
 import org.apache.sling.query.api.Predicate;
-import org.apache.sling.query.api.function.IteratorToIteratorFunction;
-import org.apache.sling.query.api.function.Option;
+import org.apache.sling.query.api.internal.IteratorToIteratorFunction;
+import org.apache.sling.query.api.internal.Option;
 import org.apache.sling.query.iterator.FilteringIterator;
 
 public class EvenFunction<T> implements IteratorToIteratorFunction<T> {

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/FilterFunction.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/FilterFunction.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/FilterFunction.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/FilterFunction.java Mon Feb  9 15:19:00 2015
@@ -22,8 +22,8 @@ package org.apache.sling.query.function;
 import java.util.Iterator;
 
 import org.apache.sling.query.api.Predicate;
-import org.apache.sling.query.api.function.IteratorToIteratorFunction;
-import org.apache.sling.query.api.function.Option;
+import org.apache.sling.query.api.internal.IteratorToIteratorFunction;
+import org.apache.sling.query.api.internal.Option;
 import org.apache.sling.query.iterator.FilteringIterator;
 
 public class FilterFunction<T> implements IteratorToIteratorFunction<T> {

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/FindFunction.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/FindFunction.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/FindFunction.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/FindFunction.java Mon Feb  9 15:19:00 2015
@@ -25,7 +25,7 @@ import java.util.List;
 
 import org.apache.sling.query.api.SearchStrategy;
 import org.apache.sling.query.api.TreeProvider;
-import org.apache.sling.query.api.function.ElementToIteratorFunction;
+import org.apache.sling.query.api.internal.ElementToIteratorFunction;
 import org.apache.sling.query.iterator.WarningIterator;
 import org.apache.sling.query.iterator.tree.BfsTreeIterator;
 import org.apache.sling.query.iterator.tree.DfsTreeIterator;

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/HasFunction.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/HasFunction.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/HasFunction.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/HasFunction.java Mon Feb  9 15:19:00 2015
@@ -21,15 +21,15 @@ package org.apache.sling.query.function;
 
 import java.util.Iterator;
 
-import org.apache.sling.query.IteratorUtils;
 import org.apache.sling.query.api.Predicate;
 import org.apache.sling.query.api.SearchStrategy;
 import org.apache.sling.query.api.TreeProvider;
-import org.apache.sling.query.api.function.ElementToIteratorFunction;
-import org.apache.sling.query.api.function.IteratorToIteratorFunction;
-import org.apache.sling.query.api.function.Option;
+import org.apache.sling.query.api.internal.ElementToIteratorFunction;
+import org.apache.sling.query.api.internal.IteratorToIteratorFunction;
+import org.apache.sling.query.api.internal.Option;
 import org.apache.sling.query.iterator.EmptyElementFilter;
 import org.apache.sling.query.selector.SelectorFunction;
+import org.apache.sling.query.util.IteratorUtils;
 
 public class HasFunction<T> implements ElementToIteratorFunction<T> {
 

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/IdentityFunction.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/IdentityFunction.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/IdentityFunction.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/IdentityFunction.java Mon Feb  9 15:19:00 2015
@@ -21,8 +21,8 @@ package org.apache.sling.query.function;
 
 import java.util.Iterator;
 
-import org.apache.sling.query.api.function.IteratorToIteratorFunction;
-import org.apache.sling.query.api.function.Option;
+import org.apache.sling.query.api.internal.IteratorToIteratorFunction;
+import org.apache.sling.query.api.internal.Option;
 
 public class IdentityFunction<T> implements IteratorToIteratorFunction<T> {
 

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/IteratorToIteratorFunctionWrapper.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/IteratorToIteratorFunctionWrapper.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/IteratorToIteratorFunctionWrapper.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/IteratorToIteratorFunctionWrapper.java Mon Feb  9 15:19:00 2015
@@ -21,10 +21,10 @@ package org.apache.sling.query.function;
 
 import java.util.Iterator;
 
-import org.apache.sling.query.api.Function;
-import org.apache.sling.query.api.function.ElementToIteratorFunction;
-import org.apache.sling.query.api.function.IteratorToIteratorFunction;
-import org.apache.sling.query.api.function.Option;
+import org.apache.sling.query.api.internal.ElementToIteratorFunction;
+import org.apache.sling.query.api.internal.Function;
+import org.apache.sling.query.api.internal.IteratorToIteratorFunction;
+import org.apache.sling.query.api.internal.Option;
 import org.apache.sling.query.iterator.ExpandingIterator;
 
 public class IteratorToIteratorFunctionWrapper<T> implements IteratorToIteratorFunction<T> {

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/LastFunction.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/LastFunction.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/LastFunction.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/LastFunction.java Mon Feb  9 15:19:00 2015
@@ -21,8 +21,8 @@ package org.apache.sling.query.function;
 
 import java.util.Iterator;
 
-import org.apache.sling.query.api.function.IteratorToIteratorFunction;
-import org.apache.sling.query.api.function.Option;
+import org.apache.sling.query.api.internal.IteratorToIteratorFunction;
+import org.apache.sling.query.api.internal.Option;
 import org.apache.sling.query.iterator.LastIterator;
 
 public class LastFunction<T> implements IteratorToIteratorFunction<T> {

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/NextFunction.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/NextFunction.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/NextFunction.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/NextFunction.java Mon Feb  9 15:19:00 2015
@@ -23,7 +23,7 @@ import java.util.Iterator;
 
 import org.apache.sling.query.api.Predicate;
 import org.apache.sling.query.api.TreeProvider;
-import org.apache.sling.query.api.function.ElementToIteratorFunction;
+import org.apache.sling.query.api.internal.ElementToIteratorFunction;
 import org.apache.sling.query.iterator.SiblingsIterator;
 import org.apache.sling.query.iterator.SiblingsIterator.Type;
 

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/NotFunction.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/NotFunction.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/NotFunction.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/NotFunction.java Mon Feb  9 15:19:00 2015
@@ -21,8 +21,8 @@ package org.apache.sling.query.function;
 
 import java.util.Iterator;
 
-import org.apache.sling.query.api.function.IteratorToIteratorFunction;
-import org.apache.sling.query.api.function.Option;
+import org.apache.sling.query.api.internal.IteratorToIteratorFunction;
+import org.apache.sling.query.api.internal.Option;
 import org.apache.sling.query.iterator.ReverseIterator;
 
 public class NotFunction<T> implements IteratorToIteratorFunction<T> {

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/ParentFunction.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/ParentFunction.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/ParentFunction.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/ParentFunction.java Mon Feb  9 15:19:00 2015
@@ -21,9 +21,9 @@ package org.apache.sling.query.function;
 
 import java.util.Iterator;
 
-import org.apache.sling.query.IteratorUtils;
 import org.apache.sling.query.api.TreeProvider;
-import org.apache.sling.query.api.function.ElementToIteratorFunction;
+import org.apache.sling.query.api.internal.ElementToIteratorFunction;
+import org.apache.sling.query.util.IteratorUtils;
 
 public class ParentFunction<T> implements ElementToIteratorFunction<T> {
 

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/ParentsFunction.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/ParentsFunction.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/ParentsFunction.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/ParentsFunction.java Mon Feb  9 15:19:00 2015
@@ -23,7 +23,7 @@ import java.util.Iterator;
 
 import org.apache.sling.query.api.Predicate;
 import org.apache.sling.query.api.TreeProvider;
-import org.apache.sling.query.api.function.ElementToIteratorFunction;
+import org.apache.sling.query.api.internal.ElementToIteratorFunction;
 import org.apache.sling.query.iterator.ParentsIterator;
 
 public class ParentsFunction<T> implements ElementToIteratorFunction<T> {

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/PrevFunction.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/PrevFunction.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/PrevFunction.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/PrevFunction.java Mon Feb  9 15:19:00 2015
@@ -23,7 +23,7 @@ import java.util.Iterator;
 
 import org.apache.sling.query.api.Predicate;
 import org.apache.sling.query.api.TreeProvider;
-import org.apache.sling.query.api.function.ElementToIteratorFunction;
+import org.apache.sling.query.api.internal.ElementToIteratorFunction;
 import org.apache.sling.query.iterator.SiblingsIterator;
 import org.apache.sling.query.iterator.SiblingsIterator.Type;
 

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/SiblingsFunction.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/SiblingsFunction.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/SiblingsFunction.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/SiblingsFunction.java Mon Feb  9 15:19:00 2015
@@ -21,9 +21,9 @@ package org.apache.sling.query.function;
 
 import java.util.Iterator;
 
-import org.apache.sling.query.IteratorUtils;
 import org.apache.sling.query.api.TreeProvider;
-import org.apache.sling.query.api.function.ElementToIteratorFunction;
+import org.apache.sling.query.api.internal.ElementToIteratorFunction;
+import org.apache.sling.query.util.IteratorUtils;
 
 public class SiblingsFunction<T> implements ElementToIteratorFunction<T> {
 

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/SliceFunction.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/SliceFunction.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/SliceFunction.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/SliceFunction.java Mon Feb  9 15:19:00 2015
@@ -21,8 +21,8 @@ package org.apache.sling.query.function;
 
 import java.util.Iterator;
 
-import org.apache.sling.query.api.function.IteratorToIteratorFunction;
-import org.apache.sling.query.api.function.Option;
+import org.apache.sling.query.api.internal.IteratorToIteratorFunction;
+import org.apache.sling.query.api.internal.Option;
 import org.apache.sling.query.iterator.SliceIterator;
 
 public class SliceFunction<T> implements IteratorToIteratorFunction<T> {

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/UniqueFunction.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/UniqueFunction.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/UniqueFunction.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/function/UniqueFunction.java Mon Feb  9 15:19:00 2015
@@ -22,8 +22,8 @@ package org.apache.sling.query.function;
 import java.util.Iterator;
 
 import org.apache.sling.query.api.TreeProvider;
-import org.apache.sling.query.api.function.IteratorToIteratorFunction;
-import org.apache.sling.query.api.function.Option;
+import org.apache.sling.query.api.internal.IteratorToIteratorFunction;
+import org.apache.sling.query.api.internal.Option;
 import org.apache.sling.query.iterator.UniqueIterator;
 
 public class UniqueFunction<T> implements IteratorToIteratorFunction<T> {

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/AlternativeIterator.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/AlternativeIterator.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/AlternativeIterator.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/AlternativeIterator.java Mon Feb  9 15:19:00 2015
@@ -22,7 +22,7 @@ package org.apache.sling.query.iterator;
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.sling.query.api.function.Option;
+import org.apache.sling.query.api.internal.Option;
 
 public class AlternativeIterator<T> extends AbstractIterator<Option<T>> {
 

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/ArgumentResettingIterator.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/ArgumentResettingIterator.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/ArgumentResettingIterator.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/ArgumentResettingIterator.java Mon Feb  9 15:19:00 2015
@@ -21,7 +21,7 @@ package org.apache.sling.query.iterator;
 
 import java.util.Iterator;
 
-import org.apache.sling.query.api.function.Option;
+import org.apache.sling.query.api.internal.Option;
 
 public class ArgumentResettingIterator<T> implements Iterator<Option<T>> {
 

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/DescendantsIterator.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/DescendantsIterator.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/DescendantsIterator.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/DescendantsIterator.java Mon Feb  9 15:19:00 2015
@@ -22,9 +22,9 @@ package org.apache.sling.query.iterator;
 import java.util.ArrayList;
 import java.util.Iterator;
 
-import org.apache.sling.query.LazyList;
 import org.apache.sling.query.api.TreeProvider;
-import org.apache.sling.query.api.function.Option;
+import org.apache.sling.query.api.internal.Option;
+import org.apache.sling.query.util.LazyList;
 
 public class DescendantsIterator<T> extends AbstractIterator<Option<T>> {
 

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/EmptyElementFilter.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/EmptyElementFilter.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/EmptyElementFilter.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/EmptyElementFilter.java Mon Feb  9 15:19:00 2015
@@ -21,7 +21,7 @@ package org.apache.sling.query.iterator;
 
 import java.util.Iterator;
 
-import org.apache.sling.query.api.function.Option;
+import org.apache.sling.query.api.internal.Option;
 
 public class EmptyElementFilter<T> extends AbstractIterator<Option<T>> {
 

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/ExpandingIterator.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/ExpandingIterator.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/ExpandingIterator.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/ExpandingIterator.java Mon Feb  9 15:19:00 2015
@@ -21,8 +21,8 @@ package org.apache.sling.query.iterator;
 
 import java.util.Iterator;
 
-import org.apache.sling.query.api.function.ElementToIteratorFunction;
-import org.apache.sling.query.api.function.Option;
+import org.apache.sling.query.api.internal.ElementToIteratorFunction;
+import org.apache.sling.query.api.internal.Option;
 
 /**
  * This iterator evaluates each element from the source iterator, expanding it using given function.

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/FilteringIterator.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/FilteringIterator.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/FilteringIterator.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/FilteringIterator.java Mon Feb  9 15:19:00 2015
@@ -22,7 +22,7 @@ package org.apache.sling.query.iterator;
 import java.util.Iterator;
 
 import org.apache.sling.query.api.Predicate;
-import org.apache.sling.query.api.function.Option;
+import org.apache.sling.query.api.internal.Option;
 
 public class FilteringIterator<T> extends AbstractIterator<Option<T>> {
 

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/LastIterator.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/LastIterator.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/LastIterator.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/LastIterator.java Mon Feb  9 15:19:00 2015
@@ -22,8 +22,8 @@ package org.apache.sling.query.iterator;
 import java.util.Iterator;
 import java.util.ListIterator;
 
-import org.apache.sling.query.LazyList;
-import org.apache.sling.query.api.function.Option;
+import org.apache.sling.query.api.internal.Option;
+import org.apache.sling.query.util.LazyList;
 
 public class LastIterator<T> extends AbstractIterator<Option<T>> {
 

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/OptionDecoratingIterator.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/OptionDecoratingIterator.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/OptionDecoratingIterator.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/OptionDecoratingIterator.java Mon Feb  9 15:19:00 2015
@@ -21,7 +21,7 @@ package org.apache.sling.query.iterator;
 
 import java.util.Iterator;
 
-import org.apache.sling.query.api.function.Option;
+import org.apache.sling.query.api.internal.Option;
 
 public class OptionDecoratingIterator<T> implements Iterator<Option<T>> {
 

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/OptionStrippingIterator.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/OptionStrippingIterator.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/OptionStrippingIterator.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/OptionStrippingIterator.java Mon Feb  9 15:19:00 2015
@@ -21,7 +21,7 @@ package org.apache.sling.query.iterator;
 
 import java.util.Iterator;
 
-import org.apache.sling.query.api.function.Option;
+import org.apache.sling.query.api.internal.Option;
 
 public class OptionStrippingIterator<T> implements Iterator<T> {
 

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/ReverseIterator.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/ReverseIterator.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/ReverseIterator.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/ReverseIterator.java Mon Feb  9 15:19:00 2015
@@ -21,9 +21,9 @@ package org.apache.sling.query.iterator;
 
 import java.util.Iterator;
 
-import org.apache.sling.query.LazyList;
-import org.apache.sling.query.api.function.IteratorToIteratorFunction;
-import org.apache.sling.query.api.function.Option;
+import org.apache.sling.query.api.internal.IteratorToIteratorFunction;
+import org.apache.sling.query.api.internal.Option;
+import org.apache.sling.query.util.LazyList;
 
 public class ReverseIterator<T> extends AbstractIterator<Option<T>> {
 

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/SiblingsIterator.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/SiblingsIterator.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/SiblingsIterator.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/SiblingsIterator.java Mon Feb  9 15:19:00 2015
@@ -22,10 +22,10 @@ package org.apache.sling.query.iterator;
 import java.util.Iterator;
 import java.util.ListIterator;
 
-import org.apache.sling.query.IteratorUtils;
-import org.apache.sling.query.LazyList;
 import org.apache.sling.query.api.Predicate;
 import org.apache.sling.query.api.TreeProvider;
+import org.apache.sling.query.util.IteratorUtils;
+import org.apache.sling.query.util.LazyList;
 
 public class SiblingsIterator<T> extends AbstractIterator<T> {
 

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/SliceIterator.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/SliceIterator.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/SliceIterator.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/SliceIterator.java Mon Feb  9 15:19:00 2015
@@ -21,7 +21,7 @@ package org.apache.sling.query.iterator;
 
 import java.util.Iterator;
 
-import org.apache.sling.query.api.function.Option;
+import org.apache.sling.query.api.internal.Option;
 
 public class SliceIterator<T> extends AbstractIterator<Option<T>> {
 

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/SuppIterator.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/SuppIterator.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/SuppIterator.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/SuppIterator.java Mon Feb  9 15:19:00 2015
@@ -22,8 +22,8 @@ package org.apache.sling.query.iterator;
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.sling.query.api.function.IteratorToIteratorFunction;
-import org.apache.sling.query.api.function.Option;
+import org.apache.sling.query.api.internal.IteratorToIteratorFunction;
+import org.apache.sling.query.api.internal.Option;
 
 /**
  * This iterator returns all elements of the input list which are mapped to non-empty values by the input

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/UniqueIterator.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/UniqueIterator.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/UniqueIterator.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/iterator/UniqueIterator.java Mon Feb  9 15:19:00 2015
@@ -22,7 +22,7 @@ package org.apache.sling.query.iterator;
 import java.util.Iterator;
 
 import org.apache.sling.query.api.TreeProvider;
-import org.apache.sling.query.api.function.Option;
+import org.apache.sling.query.api.internal.Option;
 
 public class UniqueIterator<T> extends AbstractIterator<Option<T>> {
 

Added: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/package-info.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/package-info.java?rev=1658434&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/package-info.java (added)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/package-info.java Mon Feb  9 15:19:00 2015
@@ -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.
+ */
+
+@Version("3.0.0")
+package org.apache.sling.query;
+
+import aQute.bnd.annotation.Version;
+

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/predicate/IterableContainsPredicate.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/predicate/IterableContainsPredicate.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/predicate/IterableContainsPredicate.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/predicate/IterableContainsPredicate.java Mon Feb  9 15:19:00 2015
@@ -19,9 +19,9 @@
 
 package org.apache.sling.query.predicate;
 
-import org.apache.sling.query.LazyList;
 import org.apache.sling.query.api.Predicate;
 import org.apache.sling.query.api.TreeProvider;
+import org.apache.sling.query.util.LazyList;
 
 public class IterableContainsPredicate<T> implements Predicate<T> {
 

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/selector/FunctionType.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/selector/FunctionType.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/selector/FunctionType.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/selector/FunctionType.java Mon Feb  9 15:19:00 2015
@@ -19,9 +19,9 @@
 
 package org.apache.sling.query.selector;
 
-import org.apache.sling.query.api.Function;
 import org.apache.sling.query.api.SearchStrategy;
 import org.apache.sling.query.api.TreeProvider;
+import org.apache.sling.query.api.internal.Function;
 import org.apache.sling.query.function.EvenFunction;
 import org.apache.sling.query.function.FilterFunction;
 import org.apache.sling.query.function.HasFunction;

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/selector/HierarchyOperator.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/selector/HierarchyOperator.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/selector/HierarchyOperator.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/selector/HierarchyOperator.java Mon Feb  9 15:19:00 2015
@@ -19,9 +19,9 @@
 
 package org.apache.sling.query.selector;
 
-import org.apache.sling.query.api.Function;
 import org.apache.sling.query.api.SearchStrategy;
 import org.apache.sling.query.api.TreeProvider;
+import org.apache.sling.query.api.internal.Function;
 import org.apache.sling.query.function.ChildrenFunction;
 import org.apache.sling.query.function.FindFunction;
 import org.apache.sling.query.function.IdentityFunction;

Modified: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/selector/SelectorFunction.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/selector/SelectorFunction.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/selector/SelectorFunction.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/selector/SelectorFunction.java Mon Feb  9 15:19:00 2015
@@ -23,14 +23,12 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.sling.query.IteratorUtils;
-import org.apache.sling.query.LazyList;
-import org.apache.sling.query.api.Function;
 import org.apache.sling.query.api.Predicate;
 import org.apache.sling.query.api.SearchStrategy;
 import org.apache.sling.query.api.TreeProvider;
-import org.apache.sling.query.api.function.IteratorToIteratorFunction;
-import org.apache.sling.query.api.function.Option;
+import org.apache.sling.query.api.internal.Function;
+import org.apache.sling.query.api.internal.IteratorToIteratorFunction;
+import org.apache.sling.query.api.internal.Option;
 import org.apache.sling.query.function.CompositeFunction;
 import org.apache.sling.query.function.FilterFunction;
 import org.apache.sling.query.iterator.AlternativeIterator;
@@ -40,6 +38,8 @@ import org.apache.sling.query.selector.p
 import org.apache.sling.query.selector.parser.Selector;
 import org.apache.sling.query.selector.parser.SelectorParser;
 import org.apache.sling.query.selector.parser.SelectorSegment;
+import org.apache.sling.query.util.IteratorUtils;
+import org.apache.sling.query.util.LazyList;
 
 public class SelectorFunction<T> implements IteratorToIteratorFunction<T>, Predicate<T> {
 

Added: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/util/IteratorUtils.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/util/IteratorUtils.java?rev=1658434&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/util/IteratorUtils.java (added)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/util/IteratorUtils.java Mon Feb  9 15:19:00 2015
@@ -0,0 +1,43 @@
+/*-
+ * 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.sling.query.util;
+
+import java.util.Arrays;
+import java.util.Iterator;
+
+public final class IteratorUtils {
+
+	private IteratorUtils() {
+	}
+
+	public static <T> Iterator<T> arrayIterator(T... elements) {
+		return Arrays.asList(elements).iterator();
+	}
+
+	@SuppressWarnings("unchecked")
+	public static <T> Iterator<T> singleElementIterator(T element) {
+		return Arrays.asList(element).iterator();
+	}
+
+	@SuppressWarnings("unchecked")
+	public static <T> Iterator<T> emptyIterator() {
+		return Arrays.<T> asList().iterator();
+	}
+}

Added: sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/util/LazyList.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/util/LazyList.java?rev=1658434&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/util/LazyList.java (added)
+++ sling/trunk/contrib/extensions/sling-query/src/main/java/org/apache/sling/query/util/LazyList.java Mon Feb  9 15:19:00 2015
@@ -0,0 +1,278 @@
+/*-
+ * 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.sling.query.util;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.NoSuchElementException;
+
+public class LazyList<E> implements List<E> {
+
+	private final class LazyListIterator implements ListIterator<E> {
+		private int index = 0;
+
+		private LazyListIterator() {
+			this.index = 0;
+		}
+
+		private LazyListIterator(int index) {
+			this.index = index;
+		}
+
+		@Override
+		public boolean hasNext() {
+			fillToSize(index + 1);
+			return arrayList.size() > index;
+		}
+
+		@Override
+		public E next() {
+			if (!hasNext()) {
+				throw new NoSuchElementException();
+			}
+			return arrayList.get(index++);
+		}
+
+		@Override
+		public boolean hasPrevious() {
+			return index > 0;
+		}
+
+		@Override
+		public E previous() {
+			if (!hasPrevious()) {
+				throw new NoSuchElementException();
+			}
+			fillToSize(index);
+			return arrayList.get(--index);
+		}
+
+		@Override
+		public int nextIndex() {
+			return index;
+		}
+
+		@Override
+		public int previousIndex() {
+			return index - 1;
+		}
+
+		@Override
+		public void remove() {
+			throw new UnsupportedOperationException();
+		}
+
+		@Override
+		public void set(E e) {
+			throw new UnsupportedOperationException();
+		}
+
+		@Override
+		public void add(E e) {
+			throw new UnsupportedOperationException();
+		}
+	}
+
+	private final List<E> arrayList;
+
+	private final Iterator<E> iterator;
+
+	public LazyList(Iterator<E> iterator) {
+		this.arrayList = new ArrayList<E>();
+		this.iterator = iterator;
+	}
+
+	private void fillAll() {
+		while (fillNext() != -1)
+			;
+	}
+
+	private void fillToSize(int size) {
+		for (int s = arrayList.size(); s < size; s++) {
+			if (fillNext() == -1) {
+				break;
+			}
+		}
+	}
+
+	private int fillNext() {
+		if (iterator.hasNext()) {
+			E element = iterator.next();
+			arrayList.add(element);
+			return arrayList.size() - 1;
+		}
+		return -1;
+	}
+
+	@Override
+	public int size() {
+		fillAll();
+		return arrayList.size();
+	}
+
+	@Override
+	public boolean isEmpty() {
+		return arrayList.isEmpty() && !iterator.hasNext();
+	}
+
+	@Override
+	public boolean contains(Object o) {
+		return indexOf(o) != -1;
+	}
+
+	@Override
+	public Iterator<E> iterator() {
+		return new LazyListIterator();
+	}
+
+	@Override
+	public Object[] toArray() {
+		fillAll();
+		return arrayList.toArray();
+	}
+
+	@Override
+	public <T> T[] toArray(T[] a) {
+		fillAll();
+		return arrayList.toArray(a);
+	}
+
+	@Override
+	public boolean containsAll(Collection<?> c) {
+		for (Object o : c) {
+			if (!contains(o)) {
+				return false;
+			}
+		}
+		return true;
+	}
+
+	@Override
+	public E get(int index) {
+		fillToSize(index + 1);
+		return arrayList.get(index);
+	}
+
+	@Override
+	public int indexOf(Object o) {
+		int index = arrayList.indexOf(o);
+		if (index > -1) {
+			return index;
+		}
+		int addedIndex;
+		while ((addedIndex = fillNext()) != -1) {
+			E element = arrayList.get(addedIndex);
+			if (element == null && o == null) {
+				return addedIndex;
+			} else if (element != null && element.equals(o)) {
+				return addedIndex;
+			}
+		}
+		return -1;
+	}
+
+	@Override
+	public int lastIndexOf(Object o) {
+		fillAll();
+		return arrayList.lastIndexOf(o);
+	}
+
+	@Override
+	public ListIterator<E> listIterator() {
+		return new LazyListIterator();
+	}
+
+	@Override
+	public ListIterator<E> listIterator(int index) {
+		return new LazyListIterator(index);
+	}
+
+	@Override
+	public List<E> subList(int fromIndex, int toIndex) {
+		fillToSize(toIndex);
+		return arrayList.subList(fromIndex, toIndex);
+	}
+
+	@Override
+	public boolean equals(Object o) {
+		fillAll();
+		return arrayList.equals(o);
+	}
+
+	@Override
+	public int hashCode() {
+		fillAll();
+		return arrayList.hashCode();
+	}
+
+	@Override
+	public boolean add(E e) {
+		throw new UnsupportedOperationException();
+	}
+
+	@Override
+	public boolean remove(Object o) {
+		throw new UnsupportedOperationException();
+	}
+
+	@Override
+	public boolean addAll(Collection<? extends E> c) {
+		throw new UnsupportedOperationException();
+	}
+
+	@Override
+	public boolean addAll(int index, Collection<? extends E> c) {
+		throw new UnsupportedOperationException();
+	}
+
+	@Override
+	public boolean removeAll(Collection<?> c) {
+		throw new UnsupportedOperationException();
+	}
+
+	@Override
+	public boolean retainAll(Collection<?> c) {
+		throw new UnsupportedOperationException();
+	}
+
+	@Override
+	public void clear() {
+		throw new UnsupportedOperationException();
+	}
+
+	@Override
+	public E set(int index, E element) {
+		throw new UnsupportedOperationException();
+	}
+
+	@Override
+	public void add(int index, E element) {
+		throw new UnsupportedOperationException();
+	}
+
+	@Override
+	public E remove(int index) {
+		throw new UnsupportedOperationException();
+	}
+
+}

Modified: sling/trunk/contrib/extensions/sling-query/src/test/java/org/apache/sling/query/TestUtils.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/test/java/org/apache/sling/query/TestUtils.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/test/java/org/apache/sling/query/TestUtils.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/test/java/org/apache/sling/query/TestUtils.java Mon Feb  9 15:19:00 2015
@@ -29,7 +29,7 @@ import java.util.List;
 import java.util.Set;
 
 import org.apache.sling.api.resource.Resource;
-import org.apache.sling.query.api.function.Option;
+import org.apache.sling.query.api.internal.Option;
 import org.apache.sling.query.mock.json.JsonToResource;
 import org.junit.Assert;
 

Modified: sling/trunk/contrib/extensions/sling-query/src/test/java/org/apache/sling/query/iterator/ReverseTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/test/java/org/apache/sling/query/iterator/ReverseTest.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/test/java/org/apache/sling/query/iterator/ReverseTest.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/test/java/org/apache/sling/query/iterator/ReverseTest.java Mon Feb  9 15:19:00 2015
@@ -23,8 +23,8 @@ import java.util.Iterator;
 import java.util.List;
 
 import org.apache.sling.query.TestUtils;
-import org.apache.sling.query.api.function.IteratorToIteratorFunction;
-import org.apache.sling.query.api.function.Option;
+import org.apache.sling.query.api.internal.IteratorToIteratorFunction;
+import org.apache.sling.query.api.internal.Option;
 import org.apache.sling.query.function.IdentityFunction;
 import org.apache.sling.query.function.SliceFunction;
 import org.apache.sling.query.iterator.ReverseIterator;

Modified: sling/trunk/contrib/extensions/sling-query/src/test/java/org/apache/sling/query/iterator/SuppTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/sling-query/src/test/java/org/apache/sling/query/iterator/SuppTest.java?rev=1658434&r1=1658433&r2=1658434&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/sling-query/src/test/java/org/apache/sling/query/iterator/SuppTest.java (original)
+++ sling/trunk/contrib/extensions/sling-query/src/test/java/org/apache/sling/query/iterator/SuppTest.java Mon Feb  9 15:19:00 2015
@@ -24,9 +24,9 @@ import java.util.Iterator;
 import java.util.List;
 
 import org.apache.sling.query.TestUtils;
-import org.apache.sling.query.api.function.ElementToIteratorFunction;
-import org.apache.sling.query.api.function.IteratorToIteratorFunction;
-import org.apache.sling.query.api.function.Option;
+import org.apache.sling.query.api.internal.ElementToIteratorFunction;
+import org.apache.sling.query.api.internal.IteratorToIteratorFunction;
+import org.apache.sling.query.api.internal.Option;
 import org.apache.sling.query.function.IdentityFunction;
 import org.apache.sling.query.function.IteratorToIteratorFunctionWrapper;
 import org.apache.sling.query.function.SliceFunction;



Mime
View raw message