org.basex.util
Class IntList

java.lang.Object
  extended by org.basex.util.IntList

public class IntList
extends java.lang.Object

This is a simple container for native int values.

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

Field Summary
 int[] list
          Value array.
 int size
          Number of entries.
 
Constructor Summary
IntList()
          Default constructor.
IntList(int is)
          Constructor, specifying an initial list size.
IntList(int[] v)
          Constructor, specifying an initial array.
 
Method Summary
 void add(byte[] v)
          Add array of values.
 void add(int v)
          Adds next value.
 boolean contains(int v)
          Checks if the specified value is found in the list.
 int[] finish()
          Finishes the int array.
 void reset()
          Resets the integer list.
 void set(int v, int p)
          Sets a value at the specified position.
 void sort()
          Sorts the data.
 void sort(byte[][] tok, boolean num, boolean asc)
          Sorts the data in the order of the specified token array.
 void sort(double[] num, boolean asc)
          Sorts the data in the order of the specified numeric array.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

list

public int[] list
Value array.


size

public int size
Number of entries.

Constructor Detail

IntList

public IntList()
Default constructor.


IntList

public IntList(int is)
Constructor, specifying an initial list size.

Parameters:
is - initial size of the list

IntList

public IntList(int[] v)
Constructor, specifying an initial array.

Parameters:
v - initial list values
Method Detail

add

public void add(int v)
Adds next value.

Parameters:
v - value to be added

add

public void add(byte[] v)
Add array of values.

Parameters:
v - byte[]

set

public void set(int v,
                int p)
Sets a value at the specified position.

Parameters:
v - value to be added
p - position

contains

public boolean contains(int v)
Checks if the specified value is found in the list.

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

finish

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

Returns:
int array

reset

public void reset()
Resets the integer list.


sort

public void sort()
Sorts the data.


sort

public void sort(byte[][] tok,
                 boolean num,
                 boolean asc)
Sorts the data in the order of the specified token array. Note that the input array will be resorted as well. - Sorting is derived from Java's sort algorithms in the {Arrays} class.

Parameters:
tok - token array to sort by
num - numeric sort
asc - ascending

sort

public void sort(double[] num,
                 boolean asc)
Sorts the data in the order of the specified numeric array. Note that the input array will be resorted as well. - Sorting is derived from Java's sort algorithms in the {Arrays} class.

Parameters:
num - token array to sort by
asc - ascending

toString

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