Package org.opt4j.core
Class DoubleValue
- java.lang.Object
-
- org.opt4j.core.DoubleValue
-
- All Implemented Interfaces:
Comparable<Value<Double>>
,Value<Double>
public class DoubleValue extends Object implements Value<Double>
TheDoubleValue
is aValue
with aDouble
as value. TheObjectives
contains a convenience method that allows to add aDoubleValue
without creating a new instance:Objectives.add(Objective, double)
.- See Also:
Objectives.add(Objective, double)
-
-
Constructor Summary
Constructors Constructor Description DoubleValue(Double value)
Constructs aDoubleValue
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Value<Double> arg)
boolean
equals(Object obj)
Double
getDouble()
Returns a double value.Double
getValue()
Returns the value.int
hashCode()
void
setValue(Double value)
Sets the value.String
toString()
-
-
-
Field Detail
-
value
protected Double value
-
-
Constructor Detail
-
DoubleValue
public DoubleValue(Double value)
Constructs aDoubleValue
.- Parameters:
value
- the specified value
-
-
Method Detail
-
getDouble
public Double getDouble()
Description copied from interface:Value
Returns a double value.
-
getValue
public Double getValue()
Description copied from interface:Value
Returns the value.- Specified by:
getValue
in interfaceValue<Double>
- Returns:
- the value
- See Also:
Value.setValue(V)
-
setValue
public void setValue(Double value)
Description copied from interface:Value
Sets the value.- Specified by:
setValue
in interfaceValue<Double>
- Parameters:
value
- the value to set- See Also:
Value.getValue()
-
compareTo
public int compareTo(Value<Double> arg)
- Specified by:
compareTo
in interfaceComparable<Value<Double>>
-
-