public class Range
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
double |
lowerbound |
double |
upperbound |
Constructor and Description |
---|
Range()
This constructs the range with both boundaries set to zero.
|
Range(double lowerbound,
double upperbound)
This constructs the range with the specified boundaries.
|
Modifier and Type | Method and Description |
---|---|
double |
getLength()
This returns the length of the range.
|
java.lang.String |
toString()
A String representation of the range.
|
boolean |
withinBounds(double value)
This method specifies whether or not the given value falls within the boundaries
of this range.
|
public Range()
public Range(double lowerbound, double upperbound)
lowerbound
- The lowerbound of the range.upperbound
- The upperbound of the range.public double getLength()
public boolean withinBounds(double value)
value
- The value to test for if it is within the range.public java.lang.String toString()
toString
in class java.lang.Object