package com.njcn.serviceimpl.excelreport;

import com.njcn.pojo.excelreport.ReportValueData;

import java.util.List;

public class Regroup {
    public static void regroupData(List<ReportValueData> list, boolean... b) {
        if (1 == b.length || (2 == b.length && b[1] == false)) {
            if (0 < list.size()) {
                return;
            }
        }

        Float value = null;
        int length = b[0] ? 3 : 1;

        length = (b.length == 2 && !b[1]) ? 4 : length;

        for (int i = 0; i < length; i++) {
            String str = null;

            if (b[0]) {
                switch (i) {
                    case 0:
                        str = "A";
                        break;
                    case 1:
                        str = "B";
                        break;
                    case 2:
                        str = "C";
                        break;
                    case 3:
                        str = "T";
                        break;
                }
            }

            ReportValueData reportValueData = new ReportValueData(str, value, value, value, value);
            list.add(reportValueData);
        }
    }
}
