Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
package com.aol.cyclops.lambda.tuple;
import com.aol.cyclops.lambda.tuple.lazyswap.LazySwapPTuple2;
import com.aol.cyclops.lambda.tuple.lazyswap.LazySwapPTuple3;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
public interface LazySwap {
/**
* Lazily reverse the order of the supplied PTuple. Can be used in conjunction with lazy mapping to avoid unneccasary work.
* {@code
* lazySwap(PowerTuple.of(10,11).lazyMap1(expensiveFunction));
* }
*
*/
public static PTuple2 lazySwap(PTuple2 host){
return new LazySwapPTuple2(host);
}
/**
* Lazily reverse the order of the supplied PTuple. Can be used in conjunction with lazy mapping to avoid unneccasary work.
* {@code
* lazySwap(PowerTuple.of(10,11,12).lazyMap1(expensiveFunction));
* }
*
*/
public static PTuple3 lazySwap(PTuple3 host){
return new LazySwapPTuple3<>(host);
}
/**
* Lazily reverse the order of the supplied PTuple. Can be used in conjunction with lazy mapping to avoid unneccasary work.
* {@code
* lazySwap(PowerTuple.of(10,11,12,13).lazyMap1(expensiveFunction));
* }
*
*/
public static PTuple4 lazySwap(PTuple4 host){
return new TupleImpl(Arrays.asList(),4){
public T4 v1(){
return host.v4();
}
public T3 v2(){
return host.v3();
}
public T2 v3(){
return host.v2();
}
public T1 v4(){
return host.v1();
}
@Override
public List