com.aol.cyclops.lambda.tuple.lazymap.LazyMap3PTuple8 Maven / Gradle / Ivy
package com.aol.cyclops.lambda.tuple.lazymap;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.function.Function;
import com.aol.cyclops.closures.immutable.LazyImmutable;
import com.aol.cyclops.lambda.tuple.PTuple8;
import com.aol.cyclops.lambda.tuple.TupleImpl;
public class LazyMap3PTuple8 extends TupleImpl {
private final LazyImmutable value = LazyImmutable.def();
private final Function fn;
private final PTuple8 host;
public LazyMap3PTuple8( Function fn,PTuple8 host){
super(host.arity());
this.host = host;
this.fn = fn;
}
public T v3(){
return value.computeIfAbsent(()->fn.apply(host.v3()));
}
@Override
public List