openjava.ptree
Class StatementList

java.lang.Object
  |
  +--openjava.ptree.ParseTreeObject
        |
        +--openjava.ptree.List
              |
              +--openjava.ptree.StatementList
All Implemented Interfaces:
Cloneable, ParseTree

public class StatementList
extends List

The StatementList class presents for the node of parse tree of Statement


Field Summary
private static String LNLN
           
 
Fields inherited from class openjava.ptree.List
 
Fields inherited from class openjava.ptree.ParseTreeObject
debugFlag, debugLevel, LN, out, writerStack
 
Constructor Summary
StatementList()
           
StatementList(Statement e0)
           
StatementList(Statement e0, Statement e1)
           
StatementList(Statement e0, Statement e1, Statement e2)
           
StatementList(Statement e0, Statement e1, Statement e2, Statement e3)
           
StatementList(Statement e0, Statement e1, Statement e2, Statement e3, Statement e4)
           
 
Method Summary
 void accept(ParseTreeVisitor v)
          Accepts a ParseTreeVisitor object as the role of a Visitor in the Visitor pattern, as the role of an Element in the Visitor pattern.
 void add(Statement p)
          Adds the specified element after the list This causes side-effect.
 void addAll(StatementList lst)
          Appends a list after this list.
 Statement get(int n)
          Gets the specified element at the index.
 void insertElementAt(Statement p, int n)
          Inserts the specified element into the list before the specified element of the list.
 Statement remove(int index)
          Removes the element at the specified position in this Vector.
 void set(int index, Statement p)
          Adds the specified element after the list This causes side-effect.
 StatementList subList(int from_index, int to_index)
          Returns a view of the portion of this List between fromIndex, inclusive, and toIndex, exclusive.
 
Methods inherited from class openjava.ptree.List
childrenAccept, contains, contents_addElement, contents_elementAt, contents_insertElementAt, contents_removeElementAt, contents_setElementAt, contents_size, elements, equals, isEmpty, makeRecursiveCopy, removeAll, replaceChildWith, size, writeCode
 
Methods inherited from class openjava.ptree.ParseTreeObject
clone, eq, eq, equal, flushPrintWriter, getDebugFlag, getNest, getObjectID, getParent, getPrintWriter, getTab, hashCode, lastObjectID, makeCopy, popNest, popPrintWriter, pushNest, pushPrintWriter, replace, setDebugFlag, setDebugLevel, setNest, setParent, setPrintStream, setTab, toFlattenString, toString, writeDebug, writeDebugL, writeDebugLln, writeDebugln, writeDebugLR, writeDebugR, writeDebugRln, writeTab
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface openjava.ptree.ParseTree
eq, getObjectID, makeCopy, replace, toFlattenString, toString
 

Field Detail

LNLN

private static final String LNLN
Constructor Detail

StatementList

public StatementList()

StatementList

public StatementList(Statement e0)

StatementList

public StatementList(Statement e0,
                     Statement e1)

StatementList

public StatementList(Statement e0,
                     Statement e1,
                     Statement e2)

StatementList

public StatementList(Statement e0,
                     Statement e1,
                     Statement e2,
                     Statement e3)

StatementList

public StatementList(Statement e0,
                     Statement e1,
                     Statement e2,
                     Statement e3,
                     Statement e4)
Method Detail

get

public Statement get(int n)
Gets the specified element at the index.

Parameters:
n - index

add

public void add(Statement p)
Adds the specified element after the list This causes side-effect.

Parameters:
p - Statement to be inserted into the list

set

public void set(int index,
                Statement p)
Adds the specified element after the list This causes side-effect.

Parameters:
p - Statement to be inserted into the list

remove

public Statement remove(int index)
Removes the element at the specified position in this Vector. shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the Vector.

Parameters:
index - the index of the element to removed.
Throws:
ArrayIndexOutOfBoundsException - index out of range (index < 0 || index >= size()).
Since:
JDK1.2

insertElementAt

public void insertElementAt(Statement p,
                            int n)
Inserts the specified element into the list before the specified element of the list. This causes side-effect.

Parameters:
p - the element to be inserted into the list
n - number of the element before which insertion ocuurs

addAll

public void addAll(StatementList lst)
Appends a list after this list.

Parameters:
lst - a list to be appended

subList

public StatementList subList(int from_index,
                             int to_index)
Returns a view of the portion of this List between fromIndex, inclusive, and toIndex, exclusive. The returned List is backed by this List, but changes in the returned List are not reflected in this List.

Returns:
a view of the specified range within this List.
Throws:
IndexOutOfBoundsException - Illegal endpoint index value (fromIndex < 0 || toIndex > size || fromIndex > toIndex).

accept

public void accept(ParseTreeVisitor v)
            throws ParseTreeException
Description copied from interface: ParseTree
Accepts a ParseTreeVisitor object as the role of a Visitor in the Visitor pattern, as the role of an Element in the Visitor pattern.

This invoke an appropriate visit() method on the accepted visitor.

Specified by:
accept in interface ParseTree
Specified by:
accept in class ParseTreeObject
Parameters:
v - a visitor
ParseTreeException

SourceForge.net_Logo