net.sf.javailp
Class ResultImpl

java.lang.Object
  extended by net.sf.javailp.ResultImpl
All Implemented Interfaces:
Result

public class ResultImpl
extends Object
implements Result

The class ResultImpl is a Map based implementation of the Result.


Constructor Summary
ResultImpl()
          Constructs a ResultImpl for a Problem without objective function.
ResultImpl(Linear objectiveFunction)
          Constructs a ResultImpl for a Problem with an objective function.
ResultImpl(Number objectiveValue)
          Constructs a ResultImpl for a Problem with objective function and the optimal value.
 
Method Summary
 Boolean containsVar(Object var)
          Returns true if the result contains the variable.
 Number get(Object key)
          Returns the primal value of the variable.
 boolean getBoolean(Object key)
          Returns the primal value for a specific var as a boolean.
 Number getDualValue(Object key)
          Returns the dual value of the variable.
 Number getObjective()
          Returns the objective value.
 Number getPrimalValue(Object key)
          Returns the primal value of the variable.
 void put(Object key, Number value)
          Sets the primal value of the variable.
 void putDualValue(Object key, Number value)
          Sets the dual value of the variable.
 void putPrimalValue(Object key, Number value)
          Sets the primal value of the variable.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResultImpl

public ResultImpl()
Constructs a ResultImpl for a Problem without objective function.


ResultImpl

public ResultImpl(Number objectiveValue)
Constructs a ResultImpl for a Problem with objective function and the optimal value.


ResultImpl

public ResultImpl(Linear objectiveFunction)
Constructs a ResultImpl for a Problem with an objective function.

Method Detail

getObjective

public Number getObjective()
Description copied from interface: Result
Returns the objective value.

Specified by:
getObjective in interface Result
Returns:
the objective value

getBoolean

public boolean getBoolean(Object key)
Description copied from interface: Result
Returns the primal value for a specific var as a boolean. (value!=0)

Specified by:
getBoolean in interface Result
Parameters:
key - the var
Returns:
true if the value is not 0

get

public Number get(Object key)
Description copied from interface: Result
Returns the primal value of the variable.

Specified by:
get in interface Result
Parameters:
key - the variable
Returns:
the resulting value

put

public void put(Object key,
                Number value)
Description copied from interface: Result
Sets the primal value of the variable.

Specified by:
put in interface Result
Parameters:
key - the variable
value - the value

getPrimalValue

public Number getPrimalValue(Object key)
Description copied from interface: Result
Returns the primal value of the variable.

Specified by:
getPrimalValue in interface Result
Parameters:
key - the variable
Returns:
the resulting value

putPrimalValue

public void putPrimalValue(Object key,
                           Number value)
Description copied from interface: Result
Sets the primal value of the variable.

Specified by:
putPrimalValue in interface Result
Parameters:
key - the variable
value - the value

getDualValue

public Number getDualValue(Object key)
Description copied from interface: Result
Returns the dual value of the variable.

Specified by:
getDualValue in interface Result
Parameters:
key - the variable
Returns:
the resulting value

putDualValue

public void putDualValue(Object key,
                         Number value)
Description copied from interface: Result
Sets the dual value of the variable.

Specified by:
putDualValue in interface Result
Parameters:
key - the variable
value - the value

containsVar

public Boolean containsVar(Object var)
Description copied from interface: Result
Returns true if the result contains the variable.

Specified by:
containsVar in interface Result
Parameters:
var - the variable
Returns:
true if the result contains the variable

toString

public String toString()
Overrides:
toString in class Object