de.upb.swt.mcie.robdds
Interface Assignment

All Known Implementing Classes:
HashAssignment

public interface Assignment

This interface defines the basic methods of an assignment of values to some variables of a Context. A value for each variable of the context can be 0 or 1; all other values are considered to be undefined (don't care values). There are methods that return the current value assigned to a particular variable of the context and methods for changing an assignment so some variable.

Author:
Ekkart Kindler, kindler@upb.de

Method Summary
 Context getContext()
          Returns the context of the assignment.
 int getValue(Variable variable)
          Returns the value of the assignment for the variable.
 void setValue(Variable variable, int value)
          Adds a value for a variable to the assignment.
 

Method Detail

getContext

Context getContext()
Returns the context of the assignment.

Returns:
the context of this assignment

setValue

void setValue(Variable variable,
              int value)
Adds a value for a variable to the assignment. It is an error, if the variable is from a different context than the assignment.

Parameters:
variable - the variable
value - its value
Throws:
IncorrectUseException - if the variable is from a different context than the assignment

getValue

int getValue(Variable variable)
Returns the value of the assignment for the variable. Any other value than 0 or 1 should be interpreted as undefined. It is an error, if the variable is from a different context than the assignment.

Parameters:
variable - variable for which the assigned value should be returned
Returns:
the value assigned to the variable
Throws:
IncorrectUseException - if the variable is from a different context than the assignment