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

com.jl.JTuple Maven / Gradle / Ivy

The newest version!
package com.jl;

import lombok.Data;

/**
 * 元祖
 */
public class JTuple {

    /**
     * 二维
     *
     * @param 
     * @param 
     */
    @Data
    public static class Tuple2 {

        private A v1;

        private B v2;

        public Tuple2(A v1, B v2) {
            this.v1 = v1;
            this.v2 = v2;
        }
    }

    /**
     * 三维
     *
     * @param 
     * @param 
     * @param 
     */
    @Data
    public static class Tuple3 extends Tuple2 {

        private C v3;

        public Tuple3(A v1, B v2, C v3) {
            super(v1, v2);
            this.v3 = v3;
        }
    }

    /**
     * 四维
     *
     * @param 
     * @param 
     * @param 
     * @param 
     */
    @Data
    public static class Tuple4 extends Tuple3 {

        private D v4;

        public Tuple4(A v1, B v2, C v3, D v4) {
            super(v1, v2, v3);
            this.v4 = v4;
        }
    }

    /**
     * 五维
     *
     * @param 
     * @param 
     * @param 
     * @param 
     * @param 
     */
    @Data
    public static class Tuple5 extends Tuple4 {

        private E v5;

        public Tuple5(A v1, B v2, C v3, D v4, E v5) {
            super(v1, v2, v3, v4);
            this.v5 = v5;
        }
    }
}