|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.upb.swt.mcie.robdds.HashAssignment
public class HashAssignment
This class implements an Assignment
. It is realized
as a HashMap
, which maps some variables to an
Integer
value.
Field Summary | |
---|---|
private java.util.HashMap |
assignment
The mapping representing the assignment. |
private Context |
context
The context of the assignment. |
Constructor Summary | |
---|---|
HashAssignment(Context context)
Constructs an empty assignment, i.e. a mapping that assigns don't care values (null) to each variable. |
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. |
java.lang.String |
toString()
Returns the string representation of the assignment. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private Context context
private java.util.HashMap assignment
Constructor Detail |
---|
public HashAssignment(Context context)
Method Detail |
---|
public Context getContext()
getContext
in interface Assignment
public void setValue(Variable variable, int value)
setValue
in interface Assignment
variable
- the variablevalue
- its value
IncorrectUseException
- if the variable is from
a different context than the assignmentpublic int getValue(Variable variable)
getValue
in interface Assignment
variable
- variable for which the assigned value should
be returned
IncorrectUseException
- if the variable is from
a different context than the assignmentpublic java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |