Counter’s Manipulator Methods
public void setVal(int val) {
if (val >= 0 && val <= max) this.val = val;
notifyObserver();
}
public void inc() {
if (val < max) val++;
notifyObserver();
}
public void dec() {
if (val > 0) val--;
notifyObserver();
}
Previous slide
Next slide
Back to first slide
View graphic version