package hibergui.verify;

public abstract class SelfConstraintAdapter implements SelfConstraint {
    
    Constraint c;

    public SelfConstraintAdapter(Constraint c) {
        this.c = c;
    }

    protected final boolean check(Object o) {
        return c.check(o);
    }
    
    /* 
     * Wrapper constraints are equal to the wrapped ones. This is important
     * for the proper working of the addConstraint and removeConstraint methods in
     * Edit. (removeConstraint should remove the wrapped constraint.)
     */ 
    public boolean equals(Object o) {
        if (o instanceof Constraint)
            return equals((Constraint) o);
        return super.equals(o);
    }
    
    public boolean equals(Constraint c) {
        return this.c.equals(c);
    }
}
