org.opt4j.core
Class IntegerValue

java.lang.Object
  extended by 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>

The IntegerValue is a Value with an Integer as value. The Objectives contains a convenience method that allows to add an IntegerValue without creating a new instance: Objectives.add(Objective, int).

See Also:
Objectives.add(Objective, int)

Field Summary
protected  java.lang.Integer value
           
 
Constructor Summary
IntegerValue(java.lang.Integer value)
          Constructs a IntegerValue.
 
Method Summary
 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()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

value

protected java.lang.Integer value
Constructor Detail

IntegerValue

public IntegerValue(java.lang.Integer value)
Constructs a IntegerValue.

Parameters:
value - the specified integer
Method Detail

getDouble

public java.lang.Double getDouble()
Description copied from interface: Value
Returns a double value.

Specified by:
getDouble in interface Value<java.lang.Integer>
Returns:
double value

getValue

public java.lang.Integer getValue()
Description copied from interface: Value
Returns the value.

Specified by:
getValue in interface Value<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 interface Value<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 interface java.lang.Comparable<Value<java.lang.Integer>>

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object