edu.cmu.cs.crystal.flow
Class SwitchLabel
java.lang.Object
edu.cmu.cs.crystal.flow.SwitchLabel
- All Implemented Interfaces:
- ILabel
public class SwitchLabel
- extends Object
- implements ILabel
A switch label occurs from the switch control flow.
This label maintains a link to the expression which it matched for.
- Author:
- ciera
SwitchLabel
public SwitchLabel(Expression matchExpression)
toString
public String toString()
- Overrides:
toString
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
equals
public boolean equals(Object obj)
- Overrides:
equals
in class Object
getMatchExpression
public Expression getMatchExpression()
- Returns:
- the expression which this case is matching on (not the expression it switched on)
setMatchExpression
public void setMatchExpression(Expression matchExpression)
getLabel
public String getLabel()
- Specified by:
getLabel
in interface ILabel
- Returns:
- a string representation of the matching case expression, or "default" for the default case.