package cse1030; /** * A class that represents an integer value that is always between some * minimum and maximum value. A range has three properties: minimum, * maximum, and value. Range objects always ensure that the following class invariant * is true: * *

* minimum <= value <= maximum * *

* The mutator methods of the class are responsible for ensuring that the * above class invariant is always true. For example, if the minimum value of the * range is changed so that it is greater than the current value, then the * current value is also adjusted to maintain the class invariant. If the * minimum value is changed so that it is greater than the maximum value, * then both the maximum value and current value are also changed to maintain * the class invariant. * * @author CSE1030Z * */ public class Range { // ATTRIBUTES NEEDED HERE /** * Create a range with minimum value 0, maximum value 100, and initial value * 50. */ public Range() { } /** * Create a range with the specified minimum and maximum values. The initial * value is set to half way between the minimum and maximum values (rounded * down to the nearest integer if max - min is odd). * * @param min * the minimum value of the range * @param max * the maximum value of the range * @throws IllegalArgumentException * if min > max */ public Range(int min, int max) { } /** * JAVADOC NEEDED HERE */ public Range(int min, int max, int init) { } /** * Set the current value of the range to newValue if * newValue satisfies the constraints of the range. Those * constraints are: * *

* minimum <= value <= maximum * *

* Otherwise, if newValue < minimum then the value is set to the * minimum value of the range, and if newValue > maximum then the * value is set to the maximum value of the range. * * @param value * the new value of the range */ public void setValue(int newValue) { } /** * Sets the maximum value of the range to newMaximum. The other * properties of the range may be changed to ensure that: * *

* minimum <= value <= maximum * * @param newMaximum * the new maximum of the range */ public void setMaximum(int newMaximum) { } /** * Sets the minimum value of the range to newMinimum. The other * properties of the range may be changed to ensure that: * *

* minimum <= value <= maximum * * @param newMinimum * the new minimum of the range */ public void setMinimum(int newMinimum) { } /** * Return the current value of the range. * * @return the value of the range */ public int getValue() { } /** * Returns the minimum value of the range * * @return the minimum value of the range */ public int getMinimum() { } /** * Returns the maximum value of the range * * @return the maximum value of the range */ public int getMaximum() { } }