org.eclipse.emf.henshin.interpreter.impl
Class AssignmentImpl

java.lang.Object
  extended by org.eclipse.emf.henshin.interpreter.impl.AssignmentImpl
All Implemented Interfaces:
Assignment
Direct Known Subclasses:
MatchImpl

public class AssignmentImpl
extends Object
implements Assignment

Default Assignment implementation.


Field Summary
protected  boolean isResult
           
protected  Unit unit
           
protected  Map<Object,Object> values
           
 
Constructor Summary
AssignmentImpl(Assignment assignment, boolean isResultAssignment)
          Constructor which copies an assignment.
AssignmentImpl(Unit unit)
          Default constructor.
AssignmentImpl(Unit unit, boolean isResult)
          Constructor.
 
Method Summary
 void clear()
          Clear all values stored in this assignment.
protected  void copyParameterValues(Assignment assignment)
           
 boolean equals(Object obj)
           
 Object getParameterValue(Parameter param)
          Get the value assigned to a parameter.
 List<Object> getParameterValues()
          Get all parameter values.
 Unit getUnit()
          Get the unit that this assignment refers to.
 int hashCode()
           
 boolean isEmpty()
          Check whether this assignment is empty.
 boolean isResult()
          Checks whether this is an assignment for a result of a unit application.
 void setParameterValue(Parameter param, Object value)
          Set the assigned value for a parameter.
protected  void setUnit(Unit unit)
           
protected  void setValue(Object key, Object value)
           
 String toString()
           
protected  String toStringWithIndent(String indent)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

unit

protected Unit unit

values

protected final Map<Object,Object> values

isResult

protected final boolean isResult
Constructor Detail

AssignmentImpl

public AssignmentImpl(Unit unit)
Default constructor.

Parameters:
rule - Rule to be matched.

AssignmentImpl

public AssignmentImpl(Unit unit,
                      boolean isResult)
Constructor.


AssignmentImpl

public AssignmentImpl(Assignment assignment,
                      boolean isResultAssignment)
Constructor which copies an assignment.

Parameters:
assignment - Assignment to be copied.
Method Detail

setUnit

protected void setUnit(Unit unit)

copyParameterValues

protected void copyParameterValues(Assignment assignment)

getUnit

public Unit getUnit()
Description copied from interface: Assignment
Get the unit that this assignment refers to.

Specified by:
getUnit in interface Assignment
Returns:
The unit.

getParameterValue

public Object getParameterValue(Parameter param)
Description copied from interface: Assignment
Get the value assigned to a parameter.

Specified by:
getParameterValue in interface Assignment
Parameters:
param - The parameter.
Returns:
The assigned value or null.

setValue

protected void setValue(Object key,
                        Object value)

setParameterValue

public void setParameterValue(Parameter param,
                              Object value)
Description copied from interface: Assignment
Set the assigned value for a parameter.

Specified by:
setParameterValue in interface Assignment
Parameters:
param - The parameter.
value - The value to be assigned with the parameter.

getParameterValues

public List<Object> getParameterValues()
Description copied from interface: Assignment
Get all parameter values.

Specified by:
getParameterValues in interface Assignment
Returns:
List of all parameter values.

clear

public void clear()
Description copied from interface: Assignment
Clear all values stored in this assignment.

Specified by:
clear in interface Assignment

isEmpty

public boolean isEmpty()
Description copied from interface: Assignment
Check whether this assignment is empty.

Specified by:
isEmpty in interface Assignment
Returns:
true of no values are assigned.

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

toStringWithIndent

protected String toStringWithIndent(String indent)

isResult

public boolean isResult()
Description copied from interface: Assignment
Checks whether this is an assignment for a result of a unit application.

Specified by:
isResult in interface Assignment
Returns:
true if it is a result assignment.