package com.pqs9000.serviceimpl.report;

import com.pqs9000.pojo.report.ReportValue;

import java.util.List;

public class RegroupData {
    public static void regroupData(List<ReportValue> 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;
                }
            }

            ReportValue reportValue = new ReportValue(str, value, value, value, value);
            list.add(reportValue);
        }
    }
}
