|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.co.agena.minerva.util.model.Range
public class Range
This class encapsulates a lower bound and upper bound that together define a numerical range.
Constructor Summary | |
---|---|
Range()
Creates a new Range. |
|
Range(double lowerBound,
double upperBound)
Creates a new Range with the specified lower and upper bounds. |
Method Summary | |
---|---|
boolean |
contains(double value)
Determines whether the supplied value lies in this range or not. |
boolean |
contains(double value,
boolean excludeLowerBound,
boolean excludeUpperBound)
Determines whether the supplied value lies in this range or not. |
boolean |
contains(Range r)
This method returns true if this range contains the argument range r. |
double |
getLowerBound()
Returns the lower bound. |
double |
getUpperBound()
Returns the upper bound. |
double |
midPoint()
Returns the midpoint of the upper and lower bounds |
void |
setLowerBound(double lowerBound)
Sets the lower bound. |
void |
setUpperBound(double upperBound)
Sets the upper bound. |
double |
size()
Calculates the size of the range. |
java.lang.String |
toIntString()
Rounds the range to integers and then represents as a string. |
java.lang.String |
toString()
Returns a String representation of the Range in the following format: [LOWERBOUND] - [UPPERBOUND] |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Range()
public Range(double lowerBound, double upperBound) throws MinervaRangeException
lowerBound
- the lower bound of the RangeupperBound
- the upper bound of the Range
MinervaRangeException
- if upperBound < lowerBoundMethod Detail |
---|
public double getLowerBound()
public void setLowerBound(double lowerBound)
lowerBound
- the lower boundpublic double getUpperBound()
public void setUpperBound(double upperBound)
upperBound
- the upper boundpublic double midPoint()
public boolean contains(double value)
value
- the value of interest
public boolean contains(double value, boolean excludeLowerBound, boolean excludeUpperBound)
value
- the value of interest
public double size()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toIntString()
public boolean contains(Range r)
r
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |