Package javassist.compiler.ast
Class ASTList
- java.lang.Object
-
- javassist.compiler.ast.ASTree
-
- javassist.compiler.ast.ASTList
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
ArrayInit
,CastExpr
,CondExpr
,Declarator
,Expr
,FieldDecl
,MethodDecl
,NewExpr
,Stmnt
public class ASTList extends ASTree
A linked list. The right subtree must be an ASTList object or null.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private ASTree
left
private ASTList
right
private static long
serialVersionUID
default serialVersionUID
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(Visitor v)
Is a method for the visitor pattern.static ASTList
append(ASTList a, ASTree b)
Appends an object to a list.static ASTList
concat(ASTList a, ASTList b)
Concatenates two lists.ASTree
getLeft()
ASTree
getRight()
ASTree
head()
Returns the car part of the list.int
length()
Returns the number of the elements in this list.static int
length(ASTList list)
static ASTList
make(ASTree e1, ASTree e2, ASTree e3)
void
setHead(ASTree _head)
void
setLeft(ASTree _left)
void
setRight(ASTree _right)
void
setTail(ASTList _tail)
ASTList
sublist(int nth)
Returns a sub list of the list.boolean
subst(ASTree newObj, ASTree oldObj)
SubstitutesnewObj
foroldObj
in the list.ASTList
tail()
Returns the cdr part of the list.java.lang.String
toString()
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
default serialVersionUID- See Also:
- Constant Field Values
-
left
private ASTree left
-
right
private ASTList right
-
-
Method Detail
-
head
public ASTree head()
Returns the car part of the list.
-
setHead
public void setHead(ASTree _head)
-
tail
public ASTList tail()
Returns the cdr part of the list.
-
setTail
public void setTail(ASTList _tail)
-
accept
public void accept(Visitor v) throws CompileError
Description copied from class:ASTree
Is a method for the visitor pattern. It callsatXXX()
on the given visitor, whereXXX
is the class name of the node object.- Specified by:
accept
in classASTree
- Throws:
CompileError
-
length
public int length()
Returns the number of the elements in this list.
-
length
public static int length(ASTList list)
-
sublist
public ASTList sublist(int nth)
Returns a sub list of the list. The sub list begins with the n-th element of the list.- Parameters:
nth
- zero or more than zero.
-
subst
public boolean subst(ASTree newObj, ASTree oldObj)
SubstitutesnewObj
foroldObj
in the list.
-
-