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

## Constructor Summary

Constructors
Constructor
Description
`ASTList(ASTree _head)`
`ASTList(ASTree _head, ASTList _tail)`

## Method Summary

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)`
Substitutes `newObj` for `oldObj` in the list.
`ASTList`
`tail()`
Returns the cdr part of the list.
`String`
`toString()`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### ASTList

public ASTList(ASTree _head, ASTList _tail)

### ASTList

public ASTList(ASTree _head)

## Method Details

### make

public static ASTList make(ASTree e1, ASTree e2, ASTree e3)

### getLeft

public ASTree getLeft()

Overrides:
  `getLeft` in class `ASTree`

### getRight

public ASTree getRight()

Overrides:
  `getRight` in class `ASTree`

### setLeft

public void setLeft(ASTree _left)

Overrides:
  `setLeft` in class `ASTree`

### setRight

public void setRight(ASTree _right)

Overrides:
  `setRight` in class `ASTree`

### 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: `ASTree`
Is a method for the visitor pattern. It calls `atXXX()` on the given visitor, where `XXX` is the class name of the node object.

Specified by:
  `accept` in class `ASTree`
Throws:
  `javassist.compiler.CompileError`

### toString

public String toString()

Overrides:
  `toString` in class `ASTree`

### 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)
Substitutes `newObj` for `oldObj` in the list.

### append

public static ASTList append(ASTList a, ASTree b)
Appends an object to a list.

### concat

public static ASTList concat(ASTList a, ASTList b)
Concatenates two lists.