public class IntList extends ElementList
| Modifier and Type | Field and Description |
|---|---|
protected int[] |
list
Element container.
|
CAP, size| Constructor and Description |
|---|
IntList()
Default constructor.
|
IntList(double f)
Constructor.
|
IntList(int c)
Constructor, specifying an initial array capacity.
|
IntList(int[] a)
Constructor, specifying an initial array.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(int e)
Adds an entry to the array.
|
boolean |
contains(int e)
Checks if the specified element is found in the list.
|
void |
delete(int i)
Deletes the element at the specified position.
|
int |
get(int i)
Returns the element at the specified index position.
|
void |
insert(int i,
int[] e)
Inserts elements at the specified index position.
|
void |
move(int e,
int i)
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 val)
Pushes an element onto the stack.
|
void |
set(int i,
int e)
Sets an element at the specified index 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 e)
Searches the specified element via binary search.
|
int[] |
toArray()
Returns an array with all elements.
|
java.lang.String |
toString() |
public IntList()
public IntList(int c)
c - array capacitypublic IntList(double f)
f - resize factorpublic IntList(int[] a)
a - initial arraypublic final void add(int e)
e - entry to be addedpublic final int get(int i)
i - indexpublic final void set(int i,
int e)
i - indexe - element to be setpublic final boolean contains(int e)
e - element to be foundpublic final void insert(int i,
int[] e)
i - indexe - elements to be insertedpublic final void delete(int i)
i - position to deletepublic final void move(int e,
int i)
e - differencei - indexpublic final int peek()
public final int pop()
public final void push(int val)
val - elementpublic final int sortedIndexOf(int e)
e - element to be foundpublic final int[] toArray()
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