|
||||||||||
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.IntList
public class IntList
This is a simple container for native integers.
Field Summary | |
---|---|
protected int[] |
list
Element container. |
Fields inherited from class org.basex.util.list.ElementList |
---|
factor, size |
Constructor Summary | |
---|---|
IntList()
Default constructor. |
|
IntList(double resize)
Constructor, specifying a resize factor. |
|
IntList(int capacity)
Constructor, specifying an initial internal array size. |
|
IntList(int[] elements)
Lightweight constructor, adopting the specified elements. |
Method Summary | |
---|---|
void |
add(int element)
Adds an element to the array. |
boolean |
contains(int element)
Checks if the specified element is found in the list. |
void |
delete(int element)
Removes all occurrences of the specified element from the list. |
void |
deleteAt(int index)
Deletes the element at the specified position. |
int |
get(int index)
Returns the element at the specified position. |
void |
insert(int index,
int[] element)
Inserts elements at the specified index position. |
void |
move(int diff,
int index)
Adds a difference to all elements starting from the specified index. |
int |
peek()
Returns the uppermost element from the stack. |
int |
pop()
Pops the uppermost element from the stack. |
void |
push(int element)
Pushes an element onto the stack. |
void |
set(int index,
int element)
Stores an element at the specified position. |
IntList |
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. |
void |
sort(int[] num,
boolean asc)
Sorts the data in the order of the specified numeric array. |
int |
sortedIndexOf(int element)
Searches the specified element via binary search. |
int[] |
toArray()
Returns an array with all elements. |
java.lang.String |
toString()
|
IntList |
unique()
Removes duplicates from a sorted list. |
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 |
Field Detail |
---|
protected int[] list
Constructor Detail |
---|
public IntList()
public IntList(int capacity)
capacity
- initial array capacitypublic IntList(double resize)
resize
- resize factorpublic IntList(int[] elements)
elements
- initial arrayMethod Detail |
---|
public final void add(int element)
element
- element to be addedpublic final int get(int index)
index
- index of the element to return
public final void set(int index, int element)
index
- index of the element to replaceelement
- element to be storedpublic final boolean contains(int element)
element
- element to be found
public final void insert(int index, int[] element)
index
- inserting positionelement
- elements to be insertedpublic final void delete(int element)
element
- element to be removedpublic final void deleteAt(int index)
index
- index of the element to deletepublic final void move(int diff, int index)
diff
- differenceindex
- index of the first elementpublic final int peek()
public final int pop()
public final void push(int element)
element
- elementpublic final int sortedIndexOf(int element)
element
- element to be found
public final int[] toArray()
public IntList unique()
public IntList sort()
public final void sort(byte[][] tok, boolean num, boolean asc)
Arrays.sort(int[])
.
tok
- token array to sort bynum
- numeric sortasc
- ascendingpublic final void sort(double[] num, boolean asc)
Arrays.sort(int[])
.
num
- token array to sort byasc
- ascendingpublic final void sort(int[] num, boolean asc)
Arrays.sort(int[])
.
num
- token array to sort byasc
- ascendingpublic java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |