org.basex.util
Class TokenList

java.lang.Object
  extended by org.basex.util.TokenList
All Implemented Interfaces:
java.lang.Iterable<byte[]>

public final class TokenList
extends java.lang.Object
implements java.lang.Iterable<byte[]>

This is a simple container for tokens (byte arrays).

Author:
Workgroup DBIS, University of Konstanz 2005-08, ISC License, Christian Gruen

Field Summary
 byte[][] list
          Value array.
 int size
          Current array size.
 
Constructor Summary
TokenList()
          Default constructor.
TokenList(int is)
          Constructor.
 
Method Summary
 void add(byte[] v)
          Adds next value.
 boolean contains(byte[] v)
          Checks if the specified token is found in the list.
 byte[][] finish()
          Finishes the array.
 java.lang.String[] finishString()
          Finishes the list as string array.
 java.util.Iterator<byte[]> iterator()
           
 void reset()
          Resets the integer list.
 void sort(boolean cs)
          Sorts the strings.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

list

public byte[][] list
Value array.


size

public int size
Current array size.

Constructor Detail

TokenList

public TokenList()
Default constructor.


TokenList

public TokenList(int is)
Constructor.

Parameters:
is - initial size of the list
Method Detail

add

public void add(byte[] v)
Adds next value.

Parameters:
v - value to be added

contains

public boolean contains(byte[] v)
Checks if the specified token is found in the list.

Parameters:
v - token to be checked
Returns:
true if value is found

finish

public byte[][] finish()
Finishes the array.

Returns:
array

finishString

public java.lang.String[] finishString()
Finishes the list as string array.

Returns:
array

reset

public void reset()
Resets the integer list.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

sort

public void sort(boolean cs)
Sorts the strings.

Parameters:
cs - respect case sensitivity

iterator

public java.util.Iterator<byte[]> iterator()
Specified by:
iterator in interface java.lang.Iterable<byte[]>