com.aol.cyclops.lambda.tuple.lazymap.LazyMap5PTuple8 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;
/**
* Created by johnmcclean on 5/21/15.
*/
public class LazyMap5PTuple8 extends TupleImpl {
private final LazyImmutable value = LazyImmutable.def();
private final Function fn;
private final PTuple8 host;
public LazyMap5PTuple8( Function fn,PTuple8 host){
super(host.arity());
this.host = host;
this.fn = fn;
}
public T v5(){
return value.computeIfAbsent(()->fn.apply(host.v5()));
}
@Override
public List