public abstract class List extends ASTNode
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 |
List.NodeListIterator
Used to iterate though the children of a list of AST nodes.
|
Modifier and Type | Field and Description |
---|---|
protected LinkedList |
list
(¬ø) The list being wrapped.
|
protected String |
separator
The characters appearing in between elements of the list in its string representation.
|
byteOffset, line, nodeID, symbolTable
Constructor and Description |
---|
List(int line,
int byteOffset,
String s)
Full constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o)
Determines whether this list is equivalent to another object.
|
String |
getSeparator()
Returns the separating characters.
|
int |
hashCode()
A hash code based on the hash codes of the elements of the list.
|
int |
size()
Returns the size of the list.
|
void |
sort()
Sorts the list according to their natural ordering.
|
void |
sort(Comparator c)
Sorts the list according to the order induced by the specified comparator.
|
void |
write(StringBuffer buffer)
Writes a string representation of this
ASTNode to the specified buffer. |
protected void |
writeBuffer(StringBuffer buffer,
String separate)
Writes a string representation of this
ASTNode to the specified buffer. |
protected LinkedList list
protected String separator
public List(int line, int byteOffset, String s)
line
- The line on which the source code represented by this node is found.byteOffset
- The byte offset from the beginning of the source file at which the source
code represented by this node is found.s
- The list's element separator.public int size()
public String getSeparator()
separator
.public void sort()
public void sort(Comparator c)
c
- A comparator that determines the relative ordering of two elements in the list.protected void writeBuffer(StringBuffer buffer, String separate)
ASTNode
to the specified buffer. The
representation written is parsable by the LBJava compiler, but not very readable.buffer
- The buffer to write to.public void write(StringBuffer buffer)
ASTNode
to the specified buffer. The
representation written is parsable by the LBJava compiler, but not very readable.public boolean equals(Object o)
Copyright © 2016. All rights reserved.