edu.cmu.cs.crystal.flow
Class SwitchLabel

java.lang.Object
  extended by 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

Constructor Summary
SwitchLabel(Expression matchExpression)
           
 
Method Summary
 boolean equals(Object obj)
           
 String getLabel()
           
 Expression getMatchExpression()
           
 int hashCode()
           
 void setMatchExpression(Expression matchExpression)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SwitchLabel

public SwitchLabel(Expression matchExpression)
Method Detail

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.