me.shaftesbury.utils.functional.Iterable2 Maven / Gradle / Ivy
package me.shaftesbury.utils.functional;
import org.javatuples.Pair;
import org.javatuples.Triplet;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* 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 super T,Boolean> f);
Iterable2 map(Func super T,? extends U> f);
Iterable2 mapi(final Func2 f);
Iterable2 choose(Func super T,Option> f);
boolean exists(Func super T,Boolean> f);
boolean forAll(Func super T,Boolean> f);
boolean forAll2(final Func2 super U, ? super T,Boolean> f, final Iterable input1);
U fold(Func2 super U,? super T,? extends U> f, U seed);
List toList();
Object[] toArray();
Set toSet();
Map toDictionary(final Func super T,? extends K> keyFn, final Func super T,? extends V> valueFn);
T last();
Iterable2 sortWith(final Comparator f);
Iterable2 concat(final Iterable2 list2);
T find(Func super T,Boolean> f);
int findIndex(Func super T,Boolean> f);
U pick(final Func super T,Option> f);
Iterable2 collect(final Func super T,? extends Iterable> f);
Iterable2 take(final int howMany);
Iterable2 skip(final int howMany);
String join(final String delimiter);
T findLast(final Func super T,Boolean> f);
Pair,List> partition(final Func super T,Boolean> f);
Iterable2> zip(final Iterable2 extends U> l2);
//org.javatuples.Pair,List> unzip();
Iterable2> zip3(final Iterable extends U> l2, final Iterable extends V> l3);
U in(final Func, U> f);
Map> groupBy(final Func super T, ? extends U> keyFn);
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy