package com.srbenoit.math.optimizers;
/**
* The computed value of an optimizable object, along with a flag indicating whether the parameters
* were in range or not.
*/
public class OutputValue {
/** the computed value */
private double value = 0;
/** true if the parameters were out of range; false if not */
private boolean outOfRange = false;
/**
* Gets the current value.
*
* @return the value
*/
public double getValue() {
return this.value;
}
/**
* Sets the current value.
*
* @param newValue the new value
*/
public void setValue(final double newValue) {
this.value = newValue;
}
/**
* Tests whether or not the value is out of range.
*
* @return true
if the value is out of range; false
otherwise
*/
public boolean isOutOfRange() {
return this.outOfRange;
}
/**
* Sets the flag that indicates whether or not the value is out of range.
*
* @param outOfRange true
if the value is out of range; false
* otherwise
*/
public void setOutOfRange(final boolean outOfRange) {
this.outOfRange = outOfRange;
}
/**
* Generates the string representation of the value.
*
* @return the String
*/
@Override public String toString() {
return Double.toString(this.value);
}
}