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

com.aol.cyclops.lambda.tuple.lazyswap.LazySwapPTuple3 Maven / Gradle / Ivy

There is a newer version: 7.2.4
Show newest version
package com.aol.cyclops.lambda.tuple.lazyswap;

import com.aol.cyclops.lambda.tuple.PTuple3;
import com.aol.cyclops.lambda.tuple.TupleImpl;

import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

public class LazySwapPTuple3 extends TupleImpl {


    private final PTuple3 host;

    public LazySwapPTuple3(PTuple3 host) {
        super(Arrays.asList(), 3);
        this.host = host;
    }

    public T3 v1(){
        return host.v3();
    }

    public T2 v2(){
        return host.v2();
    }

    public T1 v3(){
    	
        return host.v1();
    }


    @Override
    public List getCachedValues() {
        return Arrays.asList(v1(), v2(), v3());
    }
    @Override
    public Iterator iterator() {
        return getCachedValues().iterator();
    }


}