|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.ac.man.bioinf.util.IntArrayList
IntArrayList.java This class provides something akin to the ArrayList class but with all the methods typed as ints, which avoids the additional bloat of having to create an object for every containined integer. Created: Fri Mar 3 23:28:54 2000
Constructor Summary | |
IntArrayList()
|
|
IntArrayList(int initialCapacity)
|
Method Summary | |
void |
add(int value)
|
void |
add(int index,
int value)
|
int |
binarySearch(int key)
This method performs a binary search on the list. |
void |
clear()
|
boolean |
contains(int elem)
|
void |
ensureCapacity(int minCapacity)
|
boolean |
equals(IntArrayList list)
|
int |
get(int index)
|
IntArrayList |
getSubList(int position,
int length)
|
int |
indexOf(int elem)
|
boolean |
isEmpty()
|
int |
lastIndexOf(int elem)
|
int |
linearSearch(int key)
Provides a linear search. |
void |
print()
|
int |
remove(int index)
|
int[] |
remove(int index,
int length)
|
int |
set(int index,
int value)
|
int |
size()
|
void |
sort()
Sort the contents of this list. |
int[] |
toArray()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public IntArrayList()
public IntArrayList(int initialCapacity)
Method Detail |
public void ensureCapacity(int minCapacity)
public int size()
public boolean isEmpty()
public boolean contains(int elem)
public int indexOf(int elem)
public int lastIndexOf(int elem)
public int get(int index)
public int set(int index, int value)
public void add(int value)
public void add(int index, int value)
public int remove(int index)
public int[] remove(int index, int length)
public void clear()
public IntArrayList getSubList(int position, int length)
public int[] toArray()
public void sort()
public int binarySearch(int key)
key
- the key to search for
Arrays.binarySearch(int[],int)
public int linearSearch(int key)
key
- the key to search for
public boolean equals(IntArrayList list)
public void print()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |