diff --git a/collections-api/src/main/java/com/gs/collections/api/bag/Bag.java b/collections-api/src/main/java/com/gs/collections/api/bag/Bag.java index a50e1bf15..17e810728 100644 --- a/collections-api/src/main/java/com/gs/collections/api/bag/Bag.java +++ b/collections-api/src/main/java/com/gs/collections/api/bag/Bag.java @@ -81,7 +81,7 @@ public interface Bag *

*

      * final IntegerSum sum = new IntegerSum(0);
-     * this.forEachWithOccurrences(new ProcedureWithInt()
+     * this.forEachWithOccurrences(new ObjectIntProcedure()
      * {
      *     public void value(T each, int count)
      *     {
diff --git a/collections-api/src/main/java/com/gs/collections/api/list/ListIterable.java b/collections-api/src/main/java/com/gs/collections/api/list/ListIterable.java
index 0ce6ac89a..3e4b1e133 100644
--- a/collections-api/src/main/java/com/gs/collections/api/list/ListIterable.java
+++ b/collections-api/src/main/java/com/gs/collections/api/list/ListIterable.java
@@ -64,7 +64,7 @@ public interface ListIterable
      * 

*

e.g.
      * ListIterable people = FastList.newListWith(ted, mary, bob, sally)
-     * people.forEachWithIndex(0, 1, new ProcedureWithInt()
+     * people.forEachWithIndex(0, 1, new ObjectIntProcedure()
      * {
      *     public void value(Person person, int index)
      *     {
diff --git a/collections/src/main/java/com/gs/collections/impl/block/factory/Functions.java b/collections/src/main/java/com/gs/collections/impl/block/factory/Functions.java
index cb2543431..bf0d062d5 100644
--- a/collections/src/main/java/com/gs/collections/impl/block/factory/Functions.java
+++ b/collections/src/main/java/com/gs/collections/impl/block/factory/Functions.java
@@ -285,11 +285,11 @@ public void value(T1 each)
     }
 
     /**
-     * Bind the input of a ProcedureWithInt to the result of an function, returning a new ProcedureWithInt.
+     * Bind the input of a ObjectIntProcedure to the result of an function, returning a new ObjectIntProcedure.
      *
-     * @param delegate The ProcedureWithInt to delegate the invocation to.
+     * @param delegate The ObjectIntProcedure to delegate the invocation to.
      * @param function The Function that will create the input for the delegate
-     * @return A new ProcedureWithInt
+     * @return A new ObjectIntProcedure
      */
     public static  ObjectIntProcedure bind(
             final ObjectIntProcedure delegate,
diff --git a/collections/src/main/java/com/gs/collections/impl/block/factory/Procedures.java b/collections/src/main/java/com/gs/collections/impl/block/factory/Procedures.java
index 293e35530..bd2e67358 100644
--- a/collections/src/main/java/com/gs/collections/impl/block/factory/Procedures.java
+++ b/collections/src/main/java/com/gs/collections/impl/block/factory/Procedures.java
@@ -45,7 +45,16 @@ public static  Procedure append(Appendable appendable)
         return new AppendProcedure(appendable);
     }
 
+    /**
+     * @deprecated since 1.2 - Inlineable
+     */
+    @Deprecated
     public static  Procedure fromProcedureWithInt(ObjectIntProcedure objectIntProcedure)
+    {
+        return Procedures.fromObjectIntProcedure(objectIntProcedure);
+    }
+
+    public static  Procedure fromObjectIntProcedure(ObjectIntProcedure objectIntProcedure)
     {
         return new ObjectIntProcedureAdapter(objectIntProcedure);
     }
diff --git a/collections/src/main/java/com/gs/collections/impl/block/procedure/IfObjectIntProcedure.java b/collections/src/main/java/com/gs/collections/impl/block/procedure/IfObjectIntProcedure.java
index 2037febb3..85dec1410 100644
--- a/collections/src/main/java/com/gs/collections/impl/block/procedure/IfObjectIntProcedure.java
+++ b/collections/src/main/java/com/gs/collections/impl/block/procedure/IfObjectIntProcedure.java
@@ -22,7 +22,7 @@
 import com.gs.collections.impl.Counter;
 
 /**
- * A conditional ProcedureWithInt that effectively filters which objects should be used
+ * A conditional ObjectIntProcedure that effectively filters which objects should be used
  */
 public final class IfObjectIntProcedure
         implements Procedure
diff --git a/collections/src/main/java/com/gs/collections/impl/block/procedure/primitive/IntIntProcedure.java b/collections/src/main/java/com/gs/collections/impl/block/procedure/primitive/IntIntProcedure.java
new file mode 100644
index 000000000..b211e0bb4
--- /dev/null
+++ b/collections/src/main/java/com/gs/collections/impl/block/procedure/primitive/IntIntProcedure.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2011 Goldman Sachs.
+ *
+ * Licensed 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 com.gs.collections.impl.block.procedure.primitive;
+
+import java.io.Serializable;
+
+/**
+ * An IntIntProcedure is a two argument Closure which has no return argument and takes an int as the first and
+ * second arguments.
+ */
+public interface IntIntProcedure extends Serializable
+{
+    void value(int each, int index);
+}
diff --git a/collections/src/main/java/com/gs/collections/impl/block/procedure/primitive/IntProcedureWithInt.java b/collections/src/main/java/com/gs/collections/impl/block/procedure/primitive/IntProcedureWithInt.java
index 1c8a1f89d..2bb44dec0 100644
--- a/collections/src/main/java/com/gs/collections/impl/block/procedure/primitive/IntProcedureWithInt.java
+++ b/collections/src/main/java/com/gs/collections/impl/block/procedure/primitive/IntProcedureWithInt.java
@@ -19,9 +19,12 @@
 import java.io.Serializable;
 
 /**
- * A ProcedureWithInt is a single argument Closure which has no return argument and takes an int as a second
- * argument which is usually the index of the current element of a collection.
+ * A IntProcedureWithInt is a two argument Closure which has no return argument and takes an int as a first and second
+ * argument.  The second argument is usually the index of the current element of a collection.
+ *
+ * @deprecated since 1.2 use {@link IntIntProcedure}
  */
+@Deprecated
 public interface IntProcedureWithInt extends Serializable
 {
     void value(int each, int index);
diff --git a/collections/src/main/java/com/gs/collections/impl/list/Interval.java b/collections/src/main/java/com/gs/collections/impl/list/Interval.java
index 5a002b540..da68fccf5 100644
--- a/collections/src/main/java/com/gs/collections/impl/list/Interval.java
+++ b/collections/src/main/java/com/gs/collections/impl/list/Interval.java
@@ -45,6 +45,7 @@
 import com.gs.collections.impl.block.procedure.CollectionAddProcedure;
 import com.gs.collections.impl.block.procedure.RejectProcedure;
 import com.gs.collections.impl.block.procedure.SelectProcedure;
+import com.gs.collections.impl.block.procedure.primitive.IntIntProcedure;
 import com.gs.collections.impl.block.procedure.primitive.IntObjectProcedure;
 import com.gs.collections.impl.block.procedure.primitive.IntProcedure;
 import com.gs.collections.impl.block.procedure.primitive.IntProcedureWithInt;
@@ -379,28 +380,43 @@ private void failIfOutOfFactorialRange()
         }
     }
 
-    public void forEachWithIndex(IntProcedureWithInt procedureWithInt1)
+    /**
+     * @deprecated since 1.2 - Use {@link #forEachWithIndex(IntIntProcedure)}
+     */
+    @Deprecated
+    public void forEachWithIndex(final IntProcedureWithInt procedureWithInt)
+    {
+        this.forEachWithIndex(new IntIntProcedure()
+        {
+            public void value(int each, int index)
+            {
+                procedureWithInt.value(each, index);
+            }
+        });
+    }
+
+    public void forEachWithIndex(IntIntProcedure procedure)
     {
         int index = 0;
         if (this.from <= this.to)
         {
             for (int i = this.from; i <= this.to; i += this.step)
             {
-                procedureWithInt1.value(i, index++);
+                procedure.value(i, index++);
             }
         }
         else
         {
             for (int i = this.from; i >= this.to; i += this.step)
             {
-                procedureWithInt1.value(i, index++);
+                procedure.value(i, index++);
             }
         }
     }
 
     public void forEachWithIndex(final ObjectIntProcedure objectIntProcedure)
     {
-        this.forEachWithIndex(new IntProcedureWithInt()
+        this.forEachWithIndex(new IntIntProcedure()
         {
             public void value(int each, int index)
             {
@@ -801,7 +817,7 @@ public void value(Integer each, int index)
     public int[] toIntArray()
     {
         final int[] result = new int[this.size()];
-        this.forEachWithIndex(new IntProcedureWithInt()
+        this.forEachWithIndex(new IntIntProcedure()
         {
             public void value(int each, int index)
             {
diff --git a/collections/src/main/java/com/gs/collections/impl/list/mutable/CompositeFastList.java b/collections/src/main/java/com/gs/collections/impl/list/mutable/CompositeFastList.java
index 664c91e1a..395df247c 100644
--- a/collections/src/main/java/com/gs/collections/impl/list/mutable/CompositeFastList.java
+++ b/collections/src/main/java/com/gs/collections/impl/list/mutable/CompositeFastList.java
@@ -187,7 +187,7 @@ public void forEachWithIndex(int fromIndex, int toIndex, ObjectIntProcedure>
 {
diff --git a/collections/src/main/java/com/gs/collections/impl/parallel/ParallelIterate.java b/collections/src/main/java/com/gs/collections/impl/parallel/ParallelIterate.java
index 4a8dc4663..46b05b472 100644
--- a/collections/src/main/java/com/gs/collections/impl/parallel/ParallelIterate.java
+++ b/collections/src/main/java/com/gs/collections/impl/parallel/ParallelIterate.java
@@ -73,12 +73,12 @@ static void shutdownExecutor()
 
     /**
      * Iterate over the collection specified, in parallel batches using default runtime parameter values.  The
-     * {@code ProcedureWithInt} used must be stateless, or use concurrent aware objects if they are to be shared.
+     * {@code ObjectIntProcedure} used must be stateless, or use concurrent aware objects if they are to be shared.
      * 

* e.g. *

      * {@code final Map chm = new ConcurrentHashMap();}
-     * ParallelIterate.forEachWithIndex(collection, new ProcedureWithInt()
+     * ParallelIterate.forEachWithIndex(collection, new ObjectIntProcedure()
      * {
      *     public void value(Object object, int index)
      *     {
@@ -96,12 +96,12 @@ public static  void forEachWithIndex(
 
     /**
      * Iterate over the collection specified in parallel batches using the default runtime parameters.  The
-     * ProcedureWithInt used must be stateless, or use concurrent aware objects if they are to be shared.  The code
+     * ObjectIntProcedure used must be stateless, or use concurrent aware objects if they are to be shared.  The code
      * is executed against the specified executor.
      * 

*

e.g.
      * {@code final Map chm = new ConcurrentHashMap();}
-     * ParallelIterate.forEachWithIndex(collection, new ProcedureWithInt()
+     * ParallelIterate.forEachWithIndex(collection, new ObjectIntProcedure()
      * {
      *     public void value(Object object, int index)
      *     {
@@ -124,7 +124,7 @@ public static > void forEachWithInde
 
     /**
      * Iterate over the collection specified in parallel batches.  The
-     * ProcedureWithInt used must be stateless, or use concurrent aware objects if they are to be shared.  The
+     * ObjectIntProcedure used must be stateless, or use concurrent aware objects if they are to be shared.  The
      * specified minimum fork size and task count are used instead of the default values.
      *
      * @param minForkSize Only run in parallel if input collection is longer than this.
diff --git a/collections/src/main/java/com/gs/collections/impl/parallel/PassThruObjectIntProcedureFactory.java b/collections/src/main/java/com/gs/collections/impl/parallel/PassThruObjectIntProcedureFactory.java
index 5c487060b..30fa7e4cc 100644
--- a/collections/src/main/java/com/gs/collections/impl/parallel/PassThruObjectIntProcedureFactory.java
+++ b/collections/src/main/java/com/gs/collections/impl/parallel/PassThruObjectIntProcedureFactory.java
@@ -19,7 +19,7 @@
 import com.gs.collections.api.block.procedure.ObjectIntProcedure;
 
 /**
- * This class acts as a no op factory for a ProcedureWithInt which gets passed in and returned out.
+ * This class acts as a no op factory for a ObjectIntProcedure which gets passed in and returned out.
  */
 public final class PassThruObjectIntProcedureFactory> implements ObjectIntProcedureFactory
 {
diff --git a/collections/src/main/java/com/gs/collections/impl/utility/ArrayListIterate.java b/collections/src/main/java/com/gs/collections/impl/utility/ArrayListIterate.java
index 4e0ec2490..a964607ea 100644
--- a/collections/src/main/java/com/gs/collections/impl/utility/ArrayListIterate.java
+++ b/collections/src/main/java/com/gs/collections/impl/utility/ArrayListIterate.java
@@ -438,7 +438,7 @@ public static  void forEach(ArrayList list, int from, int to, Procedure
      * 

diff --git a/collections/src/main/java/com/gs/collections/impl/utility/ListIterate.java b/collections/src/main/java/com/gs/collections/impl/utility/ListIterate.java index 8141548f2..4885f5d88 100644 --- a/collections/src/main/java/com/gs/collections/impl/utility/ListIterate.java +++ b/collections/src/main/java/com/gs/collections/impl/utility/ListIterate.java @@ -323,7 +323,7 @@ public static void reverseForEach(List list, Procedure procedu } /** - * Interates over the section of the list covered by the specified indexes. The indexes are both inclusive. If the + * Iterates over the section of the list covered by the specified indexes. The indexes are both inclusive. If the * from is less than the to, the list is iterated in forward order. If the from is greater than the to, then the * list is iterated in the reverse order. *

@@ -371,15 +371,15 @@ public static void forEach(List list, int from, int to, Procedure *

*

e.g.
      * MutableList people = FastList.newListWith(ted, mary, bob, sally);
-     * ListIterate.forEachWithIndex(people, 0, 1, new ProcedureWithInt()
+     * ListIterate.forEachWithIndex(people, 0, 1, new ObjectIntProcedure()
      * {
      *     public void value(Person person, int index)
      *     {
diff --git a/collections/src/main/java/com/gs/collections/impl/utility/internal/RandomAccessListIterate.java b/collections/src/main/java/com/gs/collections/impl/utility/internal/RandomAccessListIterate.java
index a1d741d87..2cf25abc3 100644
--- a/collections/src/main/java/com/gs/collections/impl/utility/internal/RandomAccessListIterate.java
+++ b/collections/src/main/java/com/gs/collections/impl/utility/internal/RandomAccessListIterate.java
@@ -327,7 +327,7 @@ public static  void forEach(List list, Procedure procedure)
     }
 
     /**
-     * Interates over the section of the list covered by the specified indexes.  The indexes are both inclusive.  If the
+     * Iterates over the section of the list covered by the specified indexes.  The indexes are both inclusive.  If the
      * from is less than the to, the list is iterated in forward order. If the from is greater than the to, then the
      * list is iterated in the reverse order.
      * 

@@ -368,15 +368,15 @@ public static void forEach(List list, int from, int to, Procedure *

*

e.g.
      * MutableList people = FastList.newListWith(ted, mary, bob, sally);
-     * ListIterate.forEachWithIndex(people, 0, 1, new ProcedureWithInt()
+     * ListIterate.forEachWithIndex(people, 0, 1, new ObjectIntProcedure()
      * {
      *     public void value(Person person, int index)
      *     {
@@ -435,7 +435,7 @@ public static  void forEachInBoth(List list1, List list2, Proced
 
     /**
      * Iterates over a collection passing each element and the current relative int index to the specified instance of
-     * ProcedureWithInt.
+     * ObjectIntProcedure.
      */
     public static  void forEachWithIndex(List list, ObjectIntProcedure objectIntProcedure)
     {
diff --git a/serialization-tests/src/test/java/com/gs/collections/impl/block/factory/ProceduresTest.java b/serialization-tests/src/test/java/com/gs/collections/impl/block/factory/ProceduresTest.java
index c99337a7e..57b0ff167 100644
--- a/serialization-tests/src/test/java/com/gs/collections/impl/block/factory/ProceduresTest.java
+++ b/serialization-tests/src/test/java/com/gs/collections/impl/block/factory/ProceduresTest.java
@@ -63,6 +63,6 @@ public void asProcedure()
                         + "T2JqZWN0SW50UHJvY2VkdXJlQWRhcHRlcgAAAAAAAAABAgACSQAFY291bnRMABJvYmplY3RJbnRQ\n"
                         + "cm9jZWR1cmV0ADtMY29tL2dzL2NvbGxlY3Rpb25zL2FwaS9ibG9jay9wcm9jZWR1cmUvT2JqZWN0\n"
                         + "SW50UHJvY2VkdXJlO3hwAAAAAHA=",
-                Procedures.fromProcedureWithInt(null));
+                Procedures.fromObjectIntProcedure(null));
     }
 }
diff --git a/unit-tests/src/test/java/com/gs/collections/impl/block/CheckedBlocksTest.java b/unit-tests/src/test/java/com/gs/collections/impl/block/CheckedBlocksTest.java
index 20ab2760f..5ddf46005 100644
--- a/unit-tests/src/test/java/com/gs/collections/impl/block/CheckedBlocksTest.java
+++ b/unit-tests/src/test/java/com/gs/collections/impl/block/CheckedBlocksTest.java
@@ -167,7 +167,7 @@ public void safeValue(String object)
     }
 
     @Test
-    public void checkedProcedureWithIntCheckedException()
+    public void checkedObjectIntProcedureCheckedException()
     {
         Verify.assertThrowsWithCause(RuntimeException.class, IOException.class, new Runnable()
         {
@@ -187,7 +187,7 @@ public void safeValue(String object, int index) throws IOException
     }
 
     @Test
-    public void checkedProcedureWithIntRuntimeException()
+    public void checkedObjectIntProcedureRuntimeException()
     {
         Verify.assertThrows(LocalException.class, new Runnable()
         {
@@ -467,7 +467,7 @@ public void safeValue(Object object)
     }
 
     @Test(expected = RuntimeException.class)
-    public void procedureWithIntFailure()
+    public void objectIntProcedureFailure()
     {
         ObjectIntProcedure block = new CheckedObjectIntProcedure()
         {
@@ -481,7 +481,7 @@ public void safeValue(Object object, int index) throws InterruptedException
     }
 
     @Test(expected = RuntimeException.class)
-    public void procedureWithIntRuntimeException()
+    public void objectIntProcedureRuntimeException()
     {
         ObjectIntProcedure block = new CheckedObjectIntProcedure()
         {
@@ -495,7 +495,7 @@ public void safeValue(Object object, int index)
     }
 
     @Test
-    public void procedureWithIntSuccess()
+    public void objectIntProcedureSuccess()
     {
         ObjectIntProcedure block = new CheckedObjectIntProcedure()
         {
diff --git a/unit-tests/src/test/java/com/gs/collections/impl/block/procedure/ObjectIntProceduresTest.java b/unit-tests/src/test/java/com/gs/collections/impl/block/procedure/ObjectIntProceduresTest.java
index 9243f50b3..c6e84033b 100644
--- a/unit-tests/src/test/java/com/gs/collections/impl/block/procedure/ObjectIntProceduresTest.java
+++ b/unit-tests/src/test/java/com/gs/collections/impl/block/procedure/ObjectIntProceduresTest.java
@@ -25,7 +25,7 @@
 public class ObjectIntProceduresTest
 {
     @Test
-    public void fromProcedureWithInt()
+    public void fromObjectIntProcedure()
     {
         CollectionAddProcedure procedure = CollectionAddProcedure.on(FastList.newList());
         ObjectIntProcedure objectIntProcedure = ObjectIntProcedures.fromProcedure(procedure);
diff --git a/unit-tests/src/test/java/com/gs/collections/impl/block/procedure/ProceduresTest.java b/unit-tests/src/test/java/com/gs/collections/impl/block/procedure/ProceduresTest.java
index 877f80f15..dcf5217b2 100644
--- a/unit-tests/src/test/java/com/gs/collections/impl/block/procedure/ProceduresTest.java
+++ b/unit-tests/src/test/java/com/gs/collections/impl/block/procedure/ProceduresTest.java
@@ -69,7 +69,7 @@ public void append()
     }
 
     @Test
-    public void fromProcedureWithInt()
+    public void fromObjectIntProcedure()
     {
         ImmutableList expectedResults = Lists.immutable.of("zero0", "one1", "two2");
 
@@ -83,7 +83,7 @@ public void value(String each, int index)
         };
 
         ImmutableList numberStrings = Lists.immutable.of("zero", "one", "two");
-        Procedure procedure = Procedures.fromProcedureWithInt(objectIntProcedure);
+        Procedure procedure = Procedures.fromObjectIntProcedure(objectIntProcedure);
         numberStrings.forEach(procedure);
 
         Assert.assertEquals(expectedResults, actualResults);
diff --git a/unit-tests/src/test/java/com/gs/collections/impl/block/procedure/checked/CheckedProcedureTest.java b/unit-tests/src/test/java/com/gs/collections/impl/block/procedure/checked/CheckedProcedureTest.java
index c56d48474..750ec2ae0 100644
--- a/unit-tests/src/test/java/com/gs/collections/impl/block/procedure/checked/CheckedProcedureTest.java
+++ b/unit-tests/src/test/java/com/gs/collections/impl/block/procedure/checked/CheckedProcedureTest.java
@@ -74,7 +74,7 @@ public void safeValue(Map map)
     }
 
     @Test
-    public void checkedProcedureWithInt()
+    public void checkedObjectIntProcedure()
     {
         boolean success = false;
         try
diff --git a/unit-tests/src/test/java/com/gs/collections/impl/parallel/ObjectIntProcedureFJTaskRunnerTest.java b/unit-tests/src/test/java/com/gs/collections/impl/parallel/ObjectIntProcedureFJTaskRunnerTest.java
index 21c49c7fd..2a9b3b0f2 100644
--- a/unit-tests/src/test/java/com/gs/collections/impl/parallel/ObjectIntProcedureFJTaskRunnerTest.java
+++ b/unit-tests/src/test/java/com/gs/collections/impl/parallel/ObjectIntProcedureFJTaskRunnerTest.java
@@ -126,10 +126,10 @@ private static class PassThroughObjectIntProcedureFactory implements ObjectIntPr
     {
         public ObjectIntProcedure create()
         {
-            return this.getPassThroughProcedureWithInt();
+            return this.getPassThroughObjectIntProcedure();
         }
 
-        private ObjectIntProcedure getPassThroughProcedureWithInt()
+        private ObjectIntProcedure getPassThroughObjectIntProcedure()
         {
             return ObjectIntProcedures.fromProcedure(DoNothingProcedure.DO_NOTHING);
         }