All Downloads are FREE. Search and download functionalities are using the official Maven repository.

me.shaftesbury.utils.functional.Iterable2 Maven / Gradle / Ivy

There is a newer version: 1.17
Show newest version
package me.shaftesbury.utils.functional;

import org.javatuples.Triplet;

import java.util.Comparator;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: Bob
 * Date: 01/12/13
 * Time: 23:31
 * To change this template use File | Settings | File Templates.
 */
public interface Iterable2 extends java.lang.Iterable
{
    Iterable2 filter(Func f);
    Iterable2 map(Func f);
    Iterable2 choose(Func> f);
    boolean exists(Func f);
    boolean forAll(Func f);
    U fold(Func2 f, U seed);
    List toList();
    Iterable2 sortWith(final Comparator f);
    Iterable2 concat(final Iterable2 list2);
    T find(Func f);
    int findIndex(Func f);
    U pick(final Func> f);
    Iterable2 collect(final Func> f);

    Iterable2 take(final int howMany);

    Iterable2> zip(final Iterable2 l2);
    //org.javatuples.Pair,List> unzip();
    Iterable2> zip3(final Iterable l2, final Iterable l3);
    U in(final Func, U> f);
}