Class Iterators

java.lang.Object
org.aspectj.weaver.Iterators

public final class Iterators extends Object
  • Method Details

    • dupFilter

      public static <T> Iterators.Filter<T> dupFilter()
      Create a new filter F that, when wrapped around another iterator I, creates a new iterator I' that will return only those values of I that have not yet been returned by I', discarding duplicates.
    • array

      public static <T> Iterator<T> array(T[] o)
      Creates an iterator that will return the elements of a specified array, in order. Like Arrays.asList(o).iterator(), without all that pesky safety.
    • array

      public static Iterator<ResolvedType> array(ResolvedType[] o, boolean genericsAware)
    • mapOver

      public static <A,​ B> Iterator<B> mapOver(Iterator<A> a, Iterators.Getter<A,​B> g)
      creates an iterator I based on a base iterator A and a getter G. I returns, in order, forall (i in A), G(i).
    • recur

      public static <A> Iterator<A> recur(A a, Iterators.Getter<A,​A> g)
      creates an iterator I based on a base iterator A and a getter G. I returns, in order, forall (i in I) i :: forall (i' in g(i)) recur(i', g)
    • append

      public static <T> Iterator<T> append(Iterator<T> a, Iterator<T> b)
      creates an iterator I based on base iterators A and B. Returns the elements returned by A followed by those returned by B. If B is empty, simply returns A, and if A is empty, simply returns B. Do NOT USE if b.hasNext() is not idempotent.
    • append1

      public static <T> Iterator<T> append1(Iterator<T> a, Iterator<T> b)
      creates an iterator I based on base iterators A and B. Returns the elements returned by A followed by those returned by B. If A is empty, simply returns B. Guaranteed not to call B.hasNext() until A is empty.
    • snoc

      public static <T> Iterator<T> snoc(Iterator<T> first, T last)
      creates an iterator I based on a base iterator A and an object O. Returns the elements returned by A, followed by O.
    • one

      public static <T> Iterator<T> one(T it)
      creates an iterator I based on an object O. Returns O, once.