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

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

public final class PrintAction
extends Action

Print action AST.

Version:
CVS $Revision: 1.6 $ $Date: 2005/05/01 20:03:27 $
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
PrintAction(List<? extends PrintArg> printArgs)
          Default constructor.
 
Method Summary
 PrintAction clone()
          Clones this object (deep clone); including location info.
 void dispose()
          Disposes printArgs.
 PrintArg getPrintArg(int index)
          Gets a print argument at a specified index.
 int getPrintArgCount()
          Gets the number of print arguments.
 void setPrintArgs(List<? extends PrintArg> newPrintArgs)
          Sets the print arguments.
 String toString()
          Returns the string representation of this object.
 void visit(ASTVisitor visitor)
           
 
Methods inherited from class edu.ksu.cis.projects.bogor.ast.Action
getParent, setParent
 
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

PrintAction

public PrintAction(List<? extends PrintArg> printArgs)
Default constructor. Sets this object as each print argument's parent.

Parameters:
printArgs - The print arguments. Must be non-null. Each element must be instance of PrintArg.
Method Detail

getPrintArg

public PrintArg getPrintArg(int index)
Gets a print argument at a specified index.

Parameters:
index - The index of the print argument. Must be between 0 and getPrintArgCount() - 1, inclusive.
Returns:
The print argument at the specified index.

getPrintArgCount

public int getPrintArgCount()
Gets the number of print arguments.

Returns:
The number of print arguments. Greater than zero.

setPrintArgs

public void setPrintArgs(List<? extends PrintArg> newPrintArgs)
Sets the print arguments. Sets this object as each print argument's parent.

Parameters:
newPrintArgs - The new print arguments. Must be non-null. Each element must be instance of PrintArg.

clone

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

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

dispose

public void dispose()
Disposes printArgs. Once called, avoid using this object.

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

toString

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

Specified by:
toString in class Node
Returns:
"println(( ( , printArgs )*);".

visit

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