package hibergui.verify;

public class LongInterval extends IntervalConstraint {

    public LongInterval(Long a, Long b, int mode) {
        super(a, b, mode);
    }

    public LongInterval(Long a, Long b) {
        super(a, b);
    }

    public boolean check(Number n) {
        long a_ = a.longValue(),
             b_ = b.longValue(),
             n_ = n.longValue();
        return 
            (((mode & LEFT_OPEN) != 0) ? a_ < n_ : a_ <= n_ ) &&
            (((mode & RIGHT_OPEN) != 0) ? n_ < b_ : n_ <= b_);
    }
}
