org.apache.xalan.xsltc.util
Class IntegerArray

java.lang.Object
  extended by org.apache.xalan.xsltc.util.IntegerArray
All Implemented Interfaces:
java.lang.Cloneable

public final class IntegerArray
extends java.lang.Object
implements java.lang.Cloneable


Field Summary
private  int[] _array
           
private  int _free
           
private  int _size
           
private static int InitialSize
           
 
Constructor Summary
IntegerArray()
           
IntegerArray(int size)
           
IntegerArray(int[] array)
           
 
Method Summary
 void add(int value)
           
 void addNew(int value)
          Adds new int at the end if not already present.
 int at(int index)
           
 int cardinality()
           
 void clear()
           
 java.lang.Object clone()
           
private  void growArray(int size)
           
 int indexOf(int n)
           
 int last()
           
 void merge(IntegerArray other)
          Merge two sorted arrays and eliminate duplicates.
private static int partition(int[] array, int p, int r)
           
 void pop()
           
 void pop(int n)
           
 int popLast()
           
 void print(java.io.PrintStream out)
           
private static void quicksort(int[] array, int p, int r)
           
 void reverse()
           
 void set(int index, int value)
           
 void setLast(int n)
           
 void sort()
           
 int[] toIntArray()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

InitialSize

private static final int InitialSize
See Also:
Constant Field Values

_array

private int[] _array

_size

private int _size

_free

private int _free
Constructor Detail

IntegerArray

public IntegerArray()

IntegerArray

public IntegerArray(int size)

IntegerArray

public IntegerArray(int[] array)
Method Detail

clear

public void clear()

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

toIntArray

public int[] toIntArray()

at

public final int at(int index)

set

public final void set(int index,
                      int value)

indexOf

public int indexOf(int n)

add

public final void add(int value)

addNew

public void addNew(int value)
Adds new int at the end if not already present.


reverse

public void reverse()

merge

public void merge(IntegerArray other)
Merge two sorted arrays and eliminate duplicates. Elements of the other IntegerArray must not be changed.


sort

public void sort()

quicksort

private static void quicksort(int[] array,
                              int p,
                              int r)

partition

private static int partition(int[] array,
                             int p,
                             int r)

growArray

private void growArray(int size)

popLast

public int popLast()

last

public int last()

setLast

public void setLast(int n)

pop

public void pop()

pop

public void pop(int n)

cardinality

public final int cardinality()

print

public void print(java.io.PrintStream out)