Package org.opt4j.core
Class IntegerValue
- java.lang.Object
-
- org.opt4j.core.IntegerValue
-
- All Implemented Interfaces:
java.lang.Comparable<Value<java.lang.Integer>>
,Value<java.lang.Integer>
public class IntegerValue extends java.lang.Object implements Value<java.lang.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)
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Integer
value
-
Constructor Summary
Constructors Constructor Description IntegerValue(java.lang.Integer value)
Constructs aIntegerValue
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Value<java.lang.Integer> arg)
boolean
equals(java.lang.Object obj)
java.lang.Double
getDouble()
Returns a double value.java.lang.Integer
getValue()
Returns the value.int
hashCode()
void
setValue(java.lang.Integer value)
Sets the value.java.lang.String
toString()
-
-
-
Constructor Detail
-
IntegerValue
public IntegerValue(java.lang.Integer value)
Constructs aIntegerValue
.- Parameters:
value
- the specified integer
-
-
Method Detail
-
getDouble
public java.lang.Double getDouble()
Description copied from interface:Value
Returns a double value.
-
getValue
public java.lang.Integer getValue()
Description copied from interface:Value
Returns the value.- Specified by:
getValue
in interfaceValue<java.lang.Integer>
- Returns:
- the value
- See Also:
Value.setValue(V)
-
setValue
public void setValue(java.lang.Integer value)
Description copied from interface:Value
Sets the value.- Specified by:
setValue
in interfaceValue<java.lang.Integer>
- Parameters:
value
- the value to set- See Also:
Value.getValue()
-
compareTo
public int compareTo(Value<java.lang.Integer> arg)
- Specified by:
compareTo
in interfacejava.lang.Comparable<Value<java.lang.Integer>>
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-