Package com.treemap

Class Itertools

java.lang.Object
com.treemap.Itertools

public class Itertools extends Object
  • Constructor Details

    • Itertools

      public Itertools()
  • Method Details

    • count

      public static Iterable<Integer> count(int start, int step)
      Parameters:
      start -
      step -
      Returns:
    • count

      public static Iterable<Integer> count(int start)
    • cycle

      public static <T> Iterable<T> cycle(List<T> list)
    • repeat

      public static <T> Iterable<T> repeat(T t, int n)
      Type Parameters:
      T -
      Parameters:
      t -
      n -
      Returns:
    • repeat

      public static <T> Iterable<T> repeat(T t)
      Type Parameters:
      T -
      Parameters:
      t -
      Returns:
    • chain

      public static <T> Iterable<T> chain(List<T>... iterables)
      Type Parameters:
      T -
      Parameters:
      iterables -
      Returns:
    • compress

      public static <T> Iterable<T> compress(List<T> data, List<Boolean> selectors)
      Type Parameters:
      T -
      Parameters:
      data -
      selectors -
      Returns:
    • dropWhile

      public static <T> Iterable<T> dropWhile(Predicate<T> pred, List<T> seq)
      Type Parameters:
      T -
      Parameters:
      pred -
      seq -
      Returns:
    • ifilter

      public static <T> Iterable<T> ifilter(Predicate<T> predicate, List<T> list)
      Type Parameters:
      T -
      Parameters:
      predicate -
      list -
      Returns:
    • ifilterfalse

      public static <T> Iterable<T> ifilterfalse(Predicate<T> predicate, List<T> list)
    • islice

      public static <T> Iterable<T> islice(List<T> seq, int start, int stop, int step)
    • islice

      public static <T> Iterable<T> islice(List<T> seq, int stop, int step)
    • islice

      public static <T> Iterable<T> islice(List<T> seq, int stop)
    • imap

      public static <T, U> Iterable<U> imap(Function<T,U> f, List<T>... lists)
    • takeWhile

      public static <T> Iterable<T> takeWhile(Predicate<T> pred, List<T> seq)
    • izip

      public static <T> Iterable<List<T>> izip(List<T>... lists)
    • izipLongest

      public static <T> Iterable<List<T>> izipLongest(T fillValue, List<T>... lists)
    • product

      public static <T> Iterable<List<T>> product(List<T>... lists)
    • combinations

      public static <T> Iterable<List<T>> combinations(List<T> list, int r)
    • permutations

      public static <T> Iterable<List<T>> permutations(List<T> list, int r)