package com.njcn.pojo.data;

import java.util.ArrayList;
import java.util.List;

public class Legder {
    private String areaIndex;
    private String areaName;
    private List<pData> list;
    /*private Integer subTotal;
    private Integer lineTotal;
    private Integer gdTotal;

    public Integer getSubTotal() {
        return subTotal;
    }

    public void setSubTotal(Integer subTotal) {
        this.subTotal = subTotal;
    }

    public Integer getLineTotal() {
        return lineTotal;
    }

    public void setLineTotal(Integer lineTotal) {
        this.lineTotal = lineTotal;
    }

    public Integer getGdTotal() {
        return gdTotal;
    }

    public void setGdTotal(Integer gdTotal) {
        this.gdTotal = gdTotal;
    }*/

    public String getAreaName() {
        return areaName;
    }

    public void setAreaName(String areaName) {
        this.areaName = areaName;
    }

    public String getAreaIndex() {
        return areaIndex;
    }

    public void setAreaIndex(String areaIndex) {
        this.areaIndex = areaIndex;
    }

    public List<pData> getList() {
        return list;
    }

    public void setList(List<pData> list) {
        this.list = list;
    }

    public class pData {
        private String name;
        private List<Data> list;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public List<Data> getList() {
            return list;
        }

        public void setList(List<Data> list) {
            this.list = list;
        }
    }


    static public class Data implements Comparable<Data> {
        private Integer lineCount = 0;
        private Integer gdCount = 0;
        private Integer subCount = 0;
        private String dicIndex;
        private String dicName;
        private Float voltage;

        public Float getVoltage() {
            return voltage;
        }

        public void setVoltage(Float voltage) {
            this.voltage = voltage;
        }

        public String getDicName() {
            return dicName;
        }

        public void setDicName(String dicName) {
            this.dicName = dicName;

            try {
                this.voltage = Float.parseFloat(this.dicName.substring(0, dicName.indexOf("kV")));
            } catch (Exception e) {
                this.voltage = 0f;
            }
        }

        public String getDicIndex() {
            return dicIndex;
        }

        public void setDicIndex(String dicIndex) {
            this.dicIndex = dicIndex;
        }

        public Integer getSubCount() {
            return subCount;
        }

        public void setSubCount(Integer subCount) {
            this.subCount = subCount;
        }

        public Integer getLineCount() {
            return lineCount;
        }

        public void setLineCount(Integer lineCount) {
            this.lineCount = lineCount;
        }

        public Integer getGdCount() {
            return gdCount;
        }

        public void setGdCount(Integer gdCount) {
            this.gdCount = gdCount;
        }

        @Override
        public int compareTo(Data data) {
            return (int) (this.voltage - data.voltage);
        }
    }
}
