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