|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmapss.dif.attributes.Interval
public class Interval
Defines one dimensional inclusive or exclusive intervals. Intervals are immutable.
| Constructor Summary | |
|---|---|
Interval(double point)
Creates a point: [a,a]. |
|
Interval(double lowerBound,
boolean includesLow,
double higherBound,
boolean includesHigh)
Creates an interval. |
|
| Method Summary | |
|---|---|
protected boolean |
_isValid(double lowerBound,
boolean includesLow,
double higherBound,
boolean includesHigh)
Check if the change to the bounds can be applied or not. |
int |
compare(Interval interval)
Compares two intervals. |
boolean |
contains(double value)
Check if a given value is within this interval or not. |
double |
getHighValue()
Return the higher bound of this interval. |
double |
getLowValue()
Return the lower bound of this interval. |
boolean |
includesHigh()
True if the interval includes the higher bound. |
boolean |
includesLow()
True if the interval includes the low value. |
boolean |
intersects(Interval interval)
|
java.lang.String |
toString()
Return the string equivalent of this interval. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Interval(double point)
point - The point to create.
public Interval(double lowerBound,
boolean includesLow,
double higherBound,
boolean includesHigh)
lowerBound - The lower bound of the interval.includesLow - True if the lower bound is to be included in the
interval.higherBound - The lower bound of the interval.includesHigh - True if the higher bound is to be included in the
interval.
java.lang.IllegalArgumentException - If the interval is not valid.| Method Detail |
|---|
public int compare(Interval interval)
interval - Interval to compare with this one.
public boolean contains(double value)
value - The given value.
public double getHighValue()
public double getLowValue()
public boolean includesHigh()
public boolean includesLow()
public boolean intersects(Interval interval)
interval - Interval to compare with.
public java.lang.String toString()
toString in class java.lang.Object
protected boolean _isValid(double lowerBound,
boolean includesLow,
double higherBound,
boolean includesHigh)
lowerBound - The lower bound of the interval.includesLow - True if the lower bound is to be included in the
interval.higherBound - The lower bound of the interval.includesHigh - True if the higher bound is to be included in the
interval.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||