A RangedInt is similar to Integer but enforces upper and lower bounds
that are set at construction time.
Originally for Learning Tree International Course 471.
Constructor: Stores the maximum and minimum
values and sets the current value to 0 or
the minimum value whichever is greater.
// store the supplied limits
minValue = min;
maxValue = max;
// set the initial value of this object
if (min > 0)
currentValue = min;
else
currentValue = 0;
public RangedInt()
Default Constructor: Sets the maximum and minimum
values to MAX_VALUE and MIN_VALUE.
// call the (int, int) constructor
// with the max and min values
this(Integer.MIN_VALUE, Integer.MAX_VALUE);