package cn.com.qmth.stmms.biz.report.utils.unit;

/**
 * 表示某个分数范围的配置工具类
 * 
 * @author luoshi
 *
 */
public class LevelRange {

    private Double gt;

    private Double ge;

    private Double lt;

    private Double le;

    public LevelRange(Double gt, Double ge, Double lt, Double le) {
        this.gt = gt;
        this.ge = ge;
        this.lt = lt;
        this.le = le;
    }

    public boolean match(double value) {
        if (gt != null && value <= gt) {
            return false;
        }
        if (ge != null && value < ge) {
            return false;
        }
        if (lt != null && value >= lt) {
            return false;
        }
        if (le != null && value > le) {
            return false;
        }
        return true;
    }

    public Double getGt() {
        return gt;
    }

    public Double getGe() {
        return ge;
    }

    public Double getLt() {
        return lt;
    }

    public Double getLe() {
        return le;
    }

}
