openjava.ptree
Class ModifierList

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

public class ModifierList
extends List

The ModifierList class presents for the node of parse tree of qualified name.


Field Summary
static int ABSTRACT
           
static int EMPTY
           
static int FINAL
           
private  int mod
           
static int NATIVE
           
static int PRIVATE
           
static int PROTECTED
           
static int PUBLIC
           
static int STATIC
           
static int SYNCHRONIZED
           
static int TRANSIENT
           
static int VOLATILE
           
 
Fields inherited from class openjava.ptree.List
 
Fields inherited from class openjava.ptree.ParseTreeObject
debugFlag, debugLevel, LN, out, writerStack
 
Constructor Summary
ModifierList()
           
ModifierList(int mod)
           
ModifierList(String e0)
           
 
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(int mod)
          Adds the specified element after the list This causes side-effect.
 void add(String p)
          Adds the specified element after the list This causes side-effect.
 void append(ModifierList lst)
          Appends a list after this list.
 boolean contains(int mod)
           
 boolean contains(String str)
          Tests if any element representing the specified string is exist or not.
 String get(int n)
          Gets the specified element at
 int getRegular()
           
 void insertElementAt(String p, int n)
          Inserts the specified element into the list before the specified element of the list.
 boolean isEmpty()
          Tests if this list is empty.
 boolean isEmptyAsRegular()
           
 String remove(int n)
          Removes an element at the specified point from this list
 void set(int n, String p)
          Sets the specified element at the specified place of the list
 String toString()
          Generates string which presents for this parse-tree
static String toString(int mod)
          Return a string describing the access modifier flags in the specified modifier.
 void writeCode()
          Writes the code this parse-tree presents for.
 
Methods inherited from class openjava.ptree.List
childrenAccept, contents_addElement, contents_elementAt, contents_insertElementAt, contents_removeElementAt, contents_setElementAt, contents_size, elements, equals, makeRecursiveCopy, removeAll, replaceChildWith, size
 
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, 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
 

Field Detail

PUBLIC

public static final int PUBLIC
See Also:
Constant Field Values

PROTECTED

public static final int PROTECTED
See Also:
Constant Field Values

PRIVATE

public static final int PRIVATE
See Also:
Constant Field Values

STATIC

public static final int STATIC
See Also:
Constant Field Values

FINAL

public static final int FINAL
See Also:
Constant Field Values

SYNCHRONIZED

public static final int SYNCHRONIZED
See Also:
Constant Field Values

VOLATILE

public static final int VOLATILE
See Also:
Constant Field Values

TRANSIENT

public static final int TRANSIENT
See Also:
Constant Field Values

NATIVE

public static final int NATIVE
See Also:
Constant Field Values

ABSTRACT

public static final int ABSTRACT
See Also:
Constant Field Values

EMPTY

public static final int EMPTY
See Also:
Constant Field Values

mod

private int mod
Constructor Detail

ModifierList

public ModifierList()

ModifierList

public ModifierList(String e0)

ModifierList

public ModifierList(int mod)
Method Detail

writeCode

public void writeCode()
Description copied from class: List
Writes the code this parse-tree presents for.

Specified by:
writeCode in interface ParseTree
Overrides:
writeCode in class List

toString

public String toString()
Description copied from interface: ParseTree
Generates string which presents for this parse-tree

Specified by:
toString in interface ParseTree
Overrides:
toString in class ParseTreeObject
Returns:
string which presents for this parse-tree

toString

public static String toString(int mod)
Return a string describing the access modifier flags in the specified modifier. For example:
    public final synchronized
    private transient volatile
 
The modifier names are return in canonical order, as specified by The Java Language Specification.


isEmpty

public boolean isEmpty()
Description copied from class: List
Tests if this list is empty.

Overrides:
isEmpty in class List
Returns:
true if this list is empty

isEmptyAsRegular

public boolean isEmptyAsRegular()

contains

public boolean contains(String str)
Description copied from class: List
Tests if any element representing the specified string is exist or not.

Overrides:
contains in class List
Parameters:
str - a string to test.
Returns:
true if any element representing the specified string is exist.

contains

public boolean contains(int mod)

get

public String get(int n)
Gets the specified element at

Parameters:
n -

set

public void set(int n,
                String p)
Sets the specified element at the specified place of the list

Parameters:
p - element
n - the number where to set element

add

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


add

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

Parameters:
p - a modifier to be inserted into the list

remove

public String remove(int n)
Removes an element at the specified point from this list

Parameters:
n - where to remove element.

insertElementAt

public void insertElementAt(String 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

append

public void append(ModifierList lst)
Appends a list after this list.

Parameters:
lst - a list to be appended

getRegular

public int getRegular()

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