public class Interval extends Object
Constructor and Description |
---|
Interval(int min,
int max)
Initializes this interval with the given minimum and maximum values.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(int value)
Checks if the given value is inside this interval.
|
Interval |
copy()
Returns a copy of this interval, that is, a new interval
with the same minimium and maximum.
|
String |
toString()
Returns the string representation of this interval.
|
public Interval(int min, int max)
min
- the minimum value of this interval.max
- the maximum value of the interval.public boolean contains(int value)
value
- the value to checkpublic Interval copy()