You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2011/11/18 15:45:29 UTC

svn commit: r1203674 - in /incubator/jena/Jena2/ARQ/trunk/src/main/java/org/openjena/atlas/iterator: ActionNothing.java Iter.java

Author: andy
Date: Fri Nov 18 14:45:29 2011
New Revision: 1203674

URL: http://svn.apache.org/viewvc?rev=1203674&view=rev
Log:
Iter.consume()

Added:
    incubator/jena/Jena2/ARQ/trunk/src/main/java/org/openjena/atlas/iterator/ActionNothing.java
Modified:
    incubator/jena/Jena2/ARQ/trunk/src/main/java/org/openjena/atlas/iterator/Iter.java

Added: incubator/jena/Jena2/ARQ/trunk/src/main/java/org/openjena/atlas/iterator/ActionNothing.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/main/java/org/openjena/atlas/iterator/ActionNothing.java?rev=1203674&view=auto
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/main/java/org/openjena/atlas/iterator/ActionNothing.java (added)
+++ incubator/jena/Jena2/ARQ/trunk/src/main/java/org/openjena/atlas/iterator/ActionNothing.java Fri Nov 18 14:45:29 2011
@@ -0,0 +1,26 @@
+/*
+ * 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.openjena.atlas.iterator;
+
+
+public class ActionNothing<T> implements Action<T>
+{
+    @Override
+    public void apply(T item)   { }
+}

Modified: incubator/jena/Jena2/ARQ/trunk/src/main/java/org/openjena/atlas/iterator/Iter.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/main/java/org/openjena/atlas/iterator/Iter.java?rev=1203674&r1=1203673&r2=1203674&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/main/java/org/openjena/atlas/iterator/Iter.java (original)
+++ incubator/jena/Jena2/ARQ/trunk/src/main/java/org/openjena/atlas/iterator/Iter.java Fri Nov 18 14:45:29 2011
@@ -459,6 +459,13 @@ public class Iter<T> implements Iterable
         return action.getCount() ;
     }
 
+    // --- Consume the iterator.
+    /** Consume the iterable */
+    public static <T> void consume(Iterable<T> iterator)    { count(iterator) ; }
+
+    /** Consume the iterator */
+    public static <T> void consume(Iterator<T> iterator)    { count(iterator) ; } 
+    
     // ---- String related helpers
     
     public static <T> String asString(Iterable<T> stream)