public class ConstantList extends List
LinkedList. The code that uses it looks
a little cleaner when casts are all taken care of automatically.| Modifier and Type | Class and Description |
|---|---|
class |
ConstantList.ConstantListIterator
Used to iterate though the children of a list of AST nodes.
|
List.NodeListIteratorbyteOffset, line, nodeID, symbolTable| Constructor and Description |
|---|
ConstantList()
Default constructor.
|
ConstantList(ByteString[] a)
Creates an entire list from an array of values.
|
ConstantList(Constant c)
Initializing constructor.
|
ConstantList(String[] a)
Creates an entire list from an array of values.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(Constant c)
Adds another
Constant to the end of the list. |
void |
addAll(ConstantList l)
Adds all the
Constants in another ConstantList to the end of this
ConstantList. |
Object |
clone()
Creates a new object with the same primitive data, and recursively creates new member data
objects as well.
|
boolean |
equals(Object o)
Two
ConstantLists are equal when they contain the same elements in the same
order as evaluated by the Constant.equals(Object) method. |
int |
hashCode()
A hash code based on the hash codes of the elements of the list.
|
ASTNodeIterator |
iterator()
Returns an iterator used to successively access the children of this node.
|
ConstantList.ConstantListIterator |
listIterator()
Returns an iterator used specifically to access the elements of this list.
|
void |
runPass(Pass pass)
Ensures that the correct
run() method is called for this type of node. |
Constant[] |
toArray()
Transforms the list into an array of expressions.
|
getSeparator, size, sort, sort, write, writeBufferpublic ConstantList()
public ConstantList(Constant c)
null.c - A single Constant with which to initialize this list.public ConstantList(String[] a)
a - The array of constant values.public ConstantList(ByteString[] a)
a - The array of constant values.public void add(Constant c)
Constant to the end of the list.c - A reference to the Constant to be added.public void addAll(ConstantList l)
Constants in another ConstantList to the end of this
ConstantList.l - The list to be added.public Constant[] toArray()
public boolean equals(Object o)
ConstantLists are equal when they contain the same elements in the same
order as evaluated by the Constant.equals(Object) method.public int hashCode()
public ConstantList.ConstantListIterator listIterator()
public ASTNodeIterator iterator()
public Object clone()
Copyright © 2016. All rights reserved.