APIdia Launch Partner
Top Fields Constructors Methods
com.sun.org.apache.xalan.internal.xsltc.util

public final Class IntegerArray

extends Object
Class Inheritance

Author
Jacek Ambroziak

Field Summary

Modifier and TypeField and Description
private int[]
private int
private int
private static final int

Constructor Summary

AccessConstructor and Description
public
public
IntegerArray(int size)

public
IntegerArray(int[] array)

Method Summary

Modifier and TypeMethod and Description
public final void
add(int value)

public void
addNew(int value)

Adds new int at the end if not already present.

public final int
at(int index)

public final int
public void
public Object
clone()

Overrides java.lang.Object.clone.

Creates and returns a copy of this object.

private void
growArray(int size)

public int
indexOf(int n)

public int
last()

public void
merge(final IntegerArray other)

Merge two sorted arrays and eliminate duplicates.

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

public void
pop()

public void
pop(int n)

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

public void
public final void
set(int index, int value)

public void
setLast(int n)

public void
sort()

public int[]
Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_arrayback to summary
private int[] _array
_freeback to summary
private int _free
_sizeback to summary
private int _size
InitialSizeback to summary
private static final int InitialSize

Constructor Detail

IntegerArrayback to summary
public IntegerArray()
IntegerArrayback to summary
public IntegerArray(int size)
IntegerArrayback to summary
public IntegerArray(int[] array)

Method Detail

addback to summary
public final void add(int value)
addNewback to summary
public void addNew(int value)

Adds new int at the end if not already present.

atback to summary
public final int at(int index)
cardinalityback to summary
public final int cardinality()
clearback to summary
public void clear()
cloneback to summary
public Object clone()

Overrides java.lang.Object.clone.

Doc from java.lang.Object.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

growArrayback to summary
private void growArray(int size)
indexOfback to summary
public int indexOf(int n)
lastback to summary
public int last()
mergeback to summary
public void merge(final IntegerArray other)

Merge two sorted arrays and eliminate duplicates. Elements of the other IntegerArray must not be changed.

partitionback to summary
private static int partition(int[] array, int p, int r)
popback to summary
public void pop()
popback to summary
public void pop(int n)
popLastback to summary
public int popLast()
quicksortback to summary
private static void quicksort(int[] array, int p, int r)
reverseback to summary
public void reverse()
setback to summary
public final void set(int index, int value)
setLastback to summary
public void setLast(int n)
sortback to summary
public void sort()
toIntArrayback to summary
public int[] toIntArray()