public class TokenList extends ElementList implements java.lang.Iterable<byte[]>
CAP, size| Constructor and Description |
|---|
TokenList()
Default constructor.
|
TokenList(byte[][] a)
Constructor, specifying an initial array.
|
TokenList(double f)
Constructor.
|
TokenList(int is)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(byte[] e)
Adds an element.
|
void |
add(long e)
Adds a long value.
|
void |
add(java.lang.String e)
Adds a string.
|
boolean |
contains(byte[] e)
Checks if the specified element is found in the list.
|
void |
delete(int i)
Deletes the element at the specified position.
|
byte[] |
get(int i)
Returns the element at the specified index.
|
void |
insert(int i,
byte[][] e)
Inserts the given elements at the specified position.
|
java.util.Iterator<byte[]> |
iterator() |
byte[] |
peek()
Returns the uppermost element on the stack, without removing it.
|
byte[] |
pop()
Pops the uppermost element from the stack.
|
void |
push(byte[] val)
Pushes an element onto the stack.
|
void |
set(int i,
byte[] e)
Sets an element at the specified index.
|
TokenList |
sort(boolean cs)
Sorts the elements.
|
byte[][] |
toArray()
Returns an array with all elements.
|
java.lang.String |
toString() |
java.lang.String[] |
toStringArray()
Returns an array with all elements as strings.
|
public TokenList()
public TokenList(int is)
is - initial size of the listpublic TokenList(double f)
f - resize factorpublic TokenList(byte[][] a)
a - initial arraypublic void add(byte[] e)
e - element to be addedpublic void add(long e)
e - element to be addedpublic void add(java.lang.String e)
e - element to be addedpublic void insert(int i,
byte[][] e)
i - insert positione - elements to insertpublic void delete(int i)
i - position to deletepublic byte[] get(int i)
i - indexpublic void set(int i,
byte[] e)
i - indexe - element to be setpublic byte[] pop()
public void push(byte[] val)
val - elementpublic byte[] peek()
public boolean contains(byte[] e)
e - element to be foundpublic byte[][] toArray()
public java.lang.String[] toStringArray()
public TokenList sort(boolean cs)
cs - respect case sensitivitypublic java.util.Iterator<byte[]> iterator()
iterator in interface java.lang.Iterable<byte[]>public java.lang.String toString()
toString in class java.lang.Object