Package javassist.compiler.ast
Class ASTList
- java.lang.Object
-
- javassist.compiler.ast.ASTree
-
- javassist.compiler.ast.ASTList
-
- All Implemented Interfaces:
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
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(Visitor v)Is a method for the visitor pattern.static ASTListappend(ASTList a, ASTree b)Appends an object to a list.static ASTListconcat(ASTList a, ASTList b)Concatenates two lists.ASTreegetLeft()ASTreegetRight()ASTreehead()Returns the car part of the list.intlength()Returns the number of the elements in this list.static intlength(ASTList list)static ASTListmake(ASTree e1, ASTree e2, ASTree e3)voidsetHead(ASTree _head)voidsetLeft(ASTree _left)voidsetRight(ASTree _right)voidsetTail(ASTList _tail)ASTListsublist(int nth)Returns a sub list of the list.booleansubst(ASTree newObj, ASTree oldObj)SubstitutesnewObjforoldObjin the list.ASTListtail()Returns the cdr part of the list.StringtoString()
-
-
-
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 javassist.compiler.CompileError
Description copied from class:ASTreeIs a method for the visitor pattern. It callsatXXX()on the given visitor, whereXXXis the class name of the node object.
-
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)
SubstitutesnewObjforoldObjin the list.
-
-