/* StoppingCounter.java ** Java class that extends BoundedCounter by providing concrete versions of ** incrementFromMax() and decrementFromMin(). The intended behavior of these ** two is to have no effect. ** ** Author: R. McCloskey */ public class StoppingCounter extends BoundedCounter { // constructors // ------------ /* Initializes this StoppingCounter so that its range of possible ** count values is [min..max] and its initial count value is init. ** ** pre: min <= init <= max */ public StoppingCounter(int init, int min, int max) { super(init, min, max); } /* Initializes this StoppingCounter so that its range of possible ** count values is [min..max] and its initial count value is min. ** ** pre: min <= max */ public StoppingCounter(int min, int max) { this(min, min, max); } // mutators (concrete versions of abstract methods in parent class) // -------- /* Has no effect. ** ** pre: let c = this.countVal() ** post: this.countVal() == c */ @Override protected void incrementFromMax() { // STUB! } /* Has no effect. ** ** pre: let c = this.countVal() ** post: this.countVal() == c */ @Override protected void decrementFromMin() { // STUB! } }