public class IntList extends ElementList
Modifier and Type | Field and Description |
---|---|
protected int[] |
list
Element container.
|
CAP, factor, 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 specified element.
|
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.
|
int |
sortedIndexOf(int e)
Searches the specified element via binary search.
|
int[] |
toArray()
Returns an array with all elements.
|
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
- element to be deletedpublic 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()
Copyright © 2013 University of Konstanz, Distributed Systems Group. All Rights Reserved.