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>
TheIntegerValueis aValuewith anIntegeras value. TheObjectivescontains a convenience method that allows to add anIntegerValuewithout 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 intcompareTo(Value<Integer> arg)booleanequals(Object obj)DoublegetDouble()Returns a double value.IntegergetValue()Returns the value.inthashCode()voidsetValue(Integer value)Sets the value.StringtoString()
-
-
-
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:ValueReturns a double value.
-
getValue
public Integer getValue()
Description copied from interface:ValueReturns the value.- Specified by:
getValuein interfaceValue<Integer>- Returns:
- the value
- See Also:
Value.setValue(V)
-
setValue
public void setValue(Integer value)
Description copied from interface:ValueSets the value.- Specified by:
setValuein interfaceValue<Integer>- Parameters:
value- the value to set- See Also:
Value.getValue()
-
compareTo
public int compareTo(Value<Integer> arg)
- Specified by:
compareToin interfaceComparable<Value<Integer>>
-
-