package hibergui.verify;

public abstract class IntervalConstraint implements Constraint {
    
    public static final int
    NONE = 0,
    LEFT_OPEN = 1 << 0,
    RIGHT_OPEN = 1 << 1;
    
    protected final int mode;
    
    protected final Number a, b;
    
    public IntervalConstraint(Number a, Number b) {
        this(a, b, NONE);
    }

    public IntervalConstraint(Number a, Number b, int mode) {
        this.a = a;
        this.b = b;
        this.mode = mode;
    }

    public boolean check(Object o) {
        if (o instanceof Number)
            check((Number) o);
        return false;
    }

    public abstract boolean check(Number n);

}
