|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.basex.util.list.ElementList
org.basex.util.list.TokenList
public final class TokenList
This is a simple container for tokens (byte arrays).
Field Summary |
---|
Fields inherited from class org.basex.util.list.ElementList |
---|
factor, size |
Constructor Summary | |
---|---|
TokenList()
Default constructor. |
|
TokenList(byte[][] tokens)
Lightweight constructor, adopting the specified array. |
|
TokenList(double resize)
Constructor, specifying a resize factor. |
|
TokenList(int capacity)
Constructor, specifying an initial internal array size (default is Array.CAPACITY ). |
|
TokenList(java.lang.String[] strings)
Constructor, adopting the elements from the specified array. |
|
TokenList(TokenSet set)
Constructor, adopting the elements from the specified set. |
Method Summary | |
---|---|
void |
add(byte[] element)
Adds an element. |
void |
add(long element)
Adds a long value. |
void |
add(java.lang.String element)
Adds a string. |
boolean |
contains(byte[] element)
Checks if the specified element is found in the list. |
TokenList |
copy()
Creates a copy of this list. |
void |
deleteAt(int index)
Deletes the element at the specified position. |
byte[] |
get(int index)
Returns the element at the specified position. |
void |
insert(int index,
byte[][] elements)
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[] element)
Pushes an element onto the stack. |
void |
set(int index,
byte[] element)
Stores an element to the specified position. |
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. |
Methods inherited from class org.basex.util.list.ElementList |
---|
isEmpty, newSize, newSize, reset, size, size |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TokenList()
public TokenList(int capacity)
Array.CAPACITY
).
capacity
- initial array capacitypublic TokenList(double resize)
resize
- resize factorpublic TokenList(byte[][] tokens)
tokens
- initial arraypublic TokenList(java.lang.String[] strings)
strings
- initial arraypublic TokenList(TokenSet set)
set
- set to be addedMethod Detail |
---|
public void add(byte[] element)
element
- element to be addedpublic void add(long element)
element
- element to be addedpublic void add(java.lang.String element)
element
- element to be addedpublic void insert(int index, byte[][] elements)
index
- inserting positionelements
- elements to insertpublic void deleteAt(int index)
index
- index of the element to deletepublic byte[] get(int index)
index
- index of the element to return
public void set(int index, byte[] element)
index
- index of the element to replaceelement
- element to be storedpublic byte[] pop()
public void push(byte[] element)
element
- elementpublic byte[] peek()
public boolean contains(byte[] element)
element
- element to be found
public byte[][] toArray()
public java.lang.String[] toStringArray()
public TokenList sort(boolean cs)
cs
- respect case sensitivity
public java.util.Iterator<byte[]> iterator()
iterator
in interface java.lang.Iterable<byte[]>
public java.lang.String toString()
toString
in class java.lang.Object
public TokenList copy()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |