|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectinfo.monitorenter.util.Range
public class Range
A simple data structure that defines a minimum and a maximum and knows, what lies within it and what not.
| Field Summary | |
|---|---|
protected double |
m_max
The upper bound of this range. |
protected double |
m_min
The lower bound of this range. |
static Range |
RANGE_UNBOUNDED
The unbounded range. |
| Constructor Summary | |
|---|---|
Range(double min,
double max)
Constructs a new Range that covers the given bounds. |
|
| Method Summary | |
|---|---|
boolean |
ensureContained(double contain)
Force this Range to cover the given value. |
boolean |
equals(java.lang.Object obj)
|
double |
getExtent()
Returns the extent of this range. |
double |
getMax()
Returns the upper bound of this range. |
double |
getMin()
Returns the lower bound of this range. |
int |
hashCode()
|
boolean |
isContained(double contained)
Returns true if the given value is covered by this range. |
void |
mimic(Range r)
Mutator that shifts this range to the given one. |
void |
setMax(double max)
Sets the max value of this range. |
void |
setMin(double min)
Sets the min value of this range. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Range RANGE_UNBOUNDED
protected double m_max
protected double m_min
| Constructor Detail |
|---|
public Range(double min,
double max)
min - the lower bound for the range.max - the upper bound for the range.| Method Detail |
|---|
public boolean ensureContained(double contain)
contain - the value that has to be contained within this range.
public boolean equals(java.lang.Object obj)
equals in class java.lang.ObjectObject.equals(java.lang.Object)public double getExtent()
public double getMax()
public double getMin()
public int hashCode()
hashCode in class java.lang.ObjectObject.hashCode()public boolean isContained(double contained)
contained - the value to test wether it is contained within this range.
public void mimic(Range r)
This is support for "clone" without allocations in case range instances are reused.
r - the range to copy from.public final void setMax(double max)
max - the max to set.public final void setMin(double min)
min - the min to setpublic java.lang.String toString()
toString in class java.lang.ObjectObject.toString()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||