View Javadoc
1   /**
2    * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
3    */
4   package net.sourceforge.pmd.lang.java.symboltable;
5   
6   import java.util.Iterator;
7   
8   import net.sourceforge.pmd.util.UnaryFunction;
9   
10  public final class Applier {
11  
12      private Applier() {
13          // utility class
14      }
15  
16      public static <E> void apply(UnaryFunction<E> f, Iterator<? extends E> i) {
17          while (i.hasNext()) {
18              f.applyTo(i.next());
19          }
20      }
21  }