|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.decisiondeck.xmcda_oo.structure.DiscreteOrderedInterval
public class DiscreteOrderedInterval
A facade to an IOrderedInterval permitting easier use when the interval is discrete.
| Constructor Summary | |
|---|---|
DiscreteOrderedInterval(OrderedInterval delegate)
|
|
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
|
DiscreteOrderedInterval |
getAsDiscreteInterval()
This interval must have a step size. |
double |
getBest()
The preference direction must be set. |
double |
getClosest(double value,
boolean roundToCeiling)
Retrieves the value belonging to this discrete interval which is the closest to the given value. |
int |
getDirectionAsSign()
The preference direction must be set. |
double |
getMaximum()
Retrieves the maximum value included in this interval, or positive infinity. |
double |
getMinimum()
Retrieves the minimum value included in this interval. |
int |
getNbSteps()
The maximum must be a non infinite number. |
double |
getNonNullStepSize()
Retrieves the step size bound to this discrete interval, which is the value returned by getStepSize()
with the supplementary guarantee that it is non null. |
Criterion.PreferenceDirection |
getPreferenceDirection()
Retrieves the preference direction associated to this interval. |
Double |
getStepSize()
Retrieves the step size. |
double |
getWorst()
The preference direction must be set. |
int |
hashCode()
|
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DiscreteOrderedInterval(OrderedInterval delegate)
delegate - not null, must represent a discrete interval thus must have a step size defined (which
also implies a non infinite minimum).| Method Detail |
|---|
public double getClosest(double value,
boolean roundToCeiling)
value - the value to target.roundToCeiling - in case the given value is exactly between two steps, and this is true, the returned
value will be the highest step, if this is false, the smallest one will be returned.
public DiscreteOrderedInterval getAsDiscreteInterval()
IOrderedIntervalThis interval must have a step size.
Retrieves a facade permitting easier usage of this interval when it represents a discrete interval.
getAsDiscreteInterval in interface IOrderedIntervalnull.public double getBest()
IOrderedIntervalThe preference direction must be set.
Retrieves the maximum value if the preference direction is to maximize, the minimum value if the preference direction is to minimize. If the corresponding bound is not set this method returns a positive or negative infinity.
getBest in interface IOrderedIntervalpublic int getDirectionAsSign()
IOrderedIntervalThe preference direction must be set.
Useful for computations depending on the preference direction associated with this interval.
getDirectionAsSign in interface IOrderedIntervalpublic double getMaximum()
IOrderedIntervalIOrderedInterval.getMinimum().
getMaximum in interface IOrderedIntervalDouble.POSITIVE_INFINITY or a real number.public double getMinimum()
getMaximum() and may not be infinity.
getMinimum in interface IOrderedIntervalpublic Criterion.PreferenceDirection getPreferenceDirection()
IOrderedInterval
getPreferenceDirection in interface IOrderedIntervalnull for not set.public Double getStepSize()
getStepSize in interface IOrderedIntervalnull.public double getWorst()
IOrderedIntervalThe preference direction must be set.
Retrieves the minimum value if the preference direction is to maximize, the maximum value if the preference direction is to minimize. If the corresponding bound is not set this method returns a positive or negative infinity.
getWorst in interface IOrderedIntervalpublic int getNbSteps()
The maximum must be a non infinite number.
Retrieves the number of steps this discrete interval accepts. This is necessarily at least one. For example, the number of steps accepted by an interval from 10 to 21 by steps of 5 is three: the step 10, the step 15, the step 20.
public boolean equals(Object obj)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic double getNonNullStepSize()
getStepSize()
with the supplementary guarantee that it is non null.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||