tip.cfg
Class CIfThenElseStmPoint

java.lang.Object
  extended by tip.cfg.AProgramPoint
      extended by tip.cfg.CIfThenElseStmPoint
All Implemented Interfaces:
IProgramPoint

public class CIfThenElseStmPoint
extends AProgramPoint

CIfThenElseStmPoint is a program point in a control flow graph associated with a AIfThenElseStm.

Author:
Johnni Winther, jw@brics.dk

Constructor Summary
CIfThenElseStmPoint(AIfThenElseStm _node_)
          Creates a new CIfThenElseStmPoint associated with the AIfThenElseStm _node_ with the label "".
CIfThenElseStmPoint(AIfThenElseStm _node_, String _label_)
          Creates a new CIfThenElseStmPoint associated with the AIfThenElseStm _node_ with the label _label_.
 
Method Summary
<A> A
apply(CFGAnswer<A> caller)
          Returns an answer by calling CFGAnswer.caseCIfThenElseStmPoint(AIfThenElseStm,CIfThenElseStmPoint) the visitor caller with this program point.
<Q,A> A
apply(CFGQuestionAnswer<Q,A> caller, Q question)
          Returns an answer by calling CFGQuestionAnswer.caseCIfThenElseStmPoint(AIfThenElseStm,CIfThenElseStmPoint,Object) the visitor caller with this program point.
 boolean apply(ICFGAnalysis analysis)
          Calls ICFGAnalysis.caseCIfThenElseStmPoint(AIfThenElseStm,CIfThenElseStmPoint) on analysis and returns the result.
 CIfThenElseStmPoint clone()
          Returns a clone of the program point with no predecessors or successors.
 AIfThenElseStm getNode()
          Returns the AIfThenElseStm associated with this program point.
 String getNodeText(Answer<String> nodeText)
          Returns a textual representation of this program point by calling the Answer.caseAIfThenElseStm(AIfThenElseStm) on nodeText.
 String toString()
          Returns a textual representation of this CIfThenElseStmPoint.
 
Methods inherited from class tip.cfg.AProgramPoint
addPredecessor, addSuccessor, getPredecessors, getSuccessors, getVicinity, removePredecessor, removeSuccessor
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CIfThenElseStmPoint

public CIfThenElseStmPoint(AIfThenElseStm _node_)
Creates a new CIfThenElseStmPoint associated with the AIfThenElseStm _node_ with the label "".

Parameters:
_node_ - the AIfThenElseStm associated the the program point

CIfThenElseStmPoint

public CIfThenElseStmPoint(AIfThenElseStm _node_,
                           String _label_)
Creates a new CIfThenElseStmPoint associated with the AIfThenElseStm _node_ with the label _label_.

Parameters:
_node_ - the AIfThenElseStm associated the the program point
_label_ - the label of the program point
Method Detail

getNode

public AIfThenElseStm getNode()
Returns the AIfThenElseStm associated with this program point.

Specified by:
getNode in interface IProgramPoint
Overrides:
getNode in class AProgramPoint
Returns:
the AIfThenElseStm associated with this program point

apply

public boolean apply(ICFGAnalysis analysis)
Calls ICFGAnalysis.caseCIfThenElseStmPoint(AIfThenElseStm,CIfThenElseStmPoint) on analysis and returns the result.

Returns:
the result of calling ICFGAnalysis.caseCIfThenElseStmPoint(AIfThenElseStm,CIfThenElseStmPoint) on analysis

getNodeText

public String getNodeText(Answer<String> nodeText)
Returns a textual representation of this program point by calling the Answer.caseAIfThenElseStm(AIfThenElseStm) on nodeText.

Parameters:
nodeText - the Answer used
Returns:
a textual representation of this program point

apply

public <A> A apply(CFGAnswer<A> caller)
Returns an answer by calling CFGAnswer.caseCIfThenElseStmPoint(AIfThenElseStm,CIfThenElseStmPoint) the visitor caller with this program point.

Parameters:
caller - the Answer used
Returns:
the answer as returned from caller

apply

public <Q,A> A apply(CFGQuestionAnswer<Q,A> caller,
                     Q question)
Returns an answer by calling CFGQuestionAnswer.caseCIfThenElseStmPoint(AIfThenElseStm,CIfThenElseStmPoint,Object) the visitor caller with this program point.

Parameters:
caller - the QuestionAnswer used
question - the question used
Returns:
the answer as returned from caller on question

clone

public CIfThenElseStmPoint clone()
Returns a clone of the program point with no predecessors or successors.

Specified by:
clone in interface IProgramPoint
Specified by:
clone in class AProgramPoint
Returns:
a clone of the program point with no predecessors or successors

toString

public String toString()
Returns a textual representation of this CIfThenElseStmPoint.

Overrides:
toString in class Object
Returns:
a textual representation of this CIfThenElseStmPoint