edu.ksu.cis.projects.bogor.ast
Class Catch

java.lang.Object
  extended by edu.ksu.cis.projects.bogor.ast.Node
      extended by edu.ksu.cis.projects.bogor.ast.Catch
All Implemented Interfaces:
INextStateParent, Disposable, Serializable, Cloneable

public final class Catch
extends Node
implements INextStateParent

Catch AST.

Version:
CVS $Revision: 1.9 $ $Date: 2005/05/06 17:25:18 $
Author:
Robby
See Also:
Serialized Form

Field Summary
 
Fields inherited from class edu.ksu.cis.projects.bogor.ast.Node
ILLEGAL_LOCAL_ID_CHAR
 
Constructor Summary
Catch(boolean isLocComplement, String throwableId, String id, List<String> locIds, NextState nextState)
          Default constructor.
 
Method Summary
 Catch clone()
          Clones this object (deep clone); including location info.
 void dispose()
          Removes reference to parent, throwableId, id and locIds, and disposes nextState.
 String getId()
          Gets the id.
 String getLocationId(int index)
          Gets the location id at a specified index.
 int getLocationIdCount()
          Gets the number of location ids.
 NextState getNextState()
          Gets the nextstate
 FSM getParent()
          Gets the parent of this object.
 String getThrowableId()
          Gets the throwable id.
 boolean isLocComplement()
          Gets catch mode.
 void setId(String newId)
          Sets the id.
 void setLocationIds(List<String> newLocIds)
          Sets the location ids.
 void setLocComplement(boolean newIsLocComplement)
          Sets catch mode.
 void setNextState(NextState newNextState)
          Sets the nextstate.
 void setParent(FSM newParent)
          Sets the parent of this object.
 void setThrowableId(String newThrowableId)
          Sets the throwable id.
 String toString()
          Returns the string representation of this object.
 void visit(ASTVisitor visitor)
           
 
Methods inherited from class edu.ksu.cis.projects.bogor.ast.Node
getLocationInfo, getProperty, putProperty, setLocationInfo
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Catch

public Catch(boolean isLocComplement,
             String throwableId,
             String id,
             List<String> locIds,
             NextState nextState)
Default constructor. Sets this object as the nextstate's parent.

Parameters:
throwableId - The throwable id. Must be non-null.
id - The id. Must be non-null.
locIds - The locationd ids. Must be non-null. Each element must be instance of String. The number of elements must be greater than zero.
nextState - The nextstate. Must be non-null.
Method Detail

setLocComplement

public void setLocComplement(boolean newIsLocComplement)
Sets catch mode.

Parameters:
newIsLocComplement - The new catch mode. False if the locations not listed are the catch locations.

isLocComplement

public boolean isLocComplement()
Gets catch mode.

Returns:
The catch mode. False if the locations not listed are the catch locations.

setId

public void setId(String newId)
Sets the id.

Parameters:
newId - The new id. Must be non-null.

getId

public String getId()
Gets the id.

Returns:
The id. Non-null.

getLocationId

public String getLocationId(int index)
Gets the location id at a specified index.

Parameters:
index - The index of the location id. Must be between 0 and getLocationCount() - 1, inclusive.
Returns:
The location id at the specified index.

getLocationIdCount

public int getLocationIdCount()
Gets the number of location ids.

Returns:
The number of location ids. Greater than zero.

setLocationIds

public void setLocationIds(List<String> newLocIds)
Sets the location ids.

Parameters:
newLocIds - The new location ids. Must be non-null. Each element must be instance of String. The number of elements must be greater than zero.

setNextState

public void setNextState(NextState newNextState)
Sets the nextstate. Sets this object as the nextstate's parent.

Parameters:
newNextState - The new nextstate. Must be non-null.

getNextState

public NextState getNextState()
Gets the nextstate

Returns:
The nextstate. Non-null.

setParent

public void setParent(FSM newParent)
Sets the parent of this object.

Parameters:
newParent - The new parent. Must be non-null.

getParent

public FSM getParent()
Gets the parent of this object.

Returns:
The parent of this object.

setThrowableId

public void setThrowableId(String newThrowableId)
Sets the throwable id.

Parameters:
newThrowableId - The new throwable id. Must be non-null.

getThrowableId

public String getThrowableId()
Gets the throwable id.

Returns:
The throwable id. Non-null.

clone

public Catch clone()
Clones this object (deep clone); including location info.

Specified by:
clone in class Node
Returns:
The clone of this object. Non-null.

dispose

public void dispose()
Removes reference to parent, throwableId, id and locIds, and disposes nextState. Once called, avoid using this object.

Specified by:
dispose in interface Disposable
Overrides:
dispose in class Node

toString

public String toString()
Returns the string representation of this object.

Specified by:
toString in class Node
Returns:
Returns "catch throwableId id at ( locIds , )* nextState;".

visit

public void visit(ASTVisitor visitor)
Specified by:
visit in class Node