|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectkorat.utils.IntList
public class IntList
Slow - use one of its derivatives, BS or AI
IntListAI
,
IntListBS
Field Summary | |
---|---|
private static int |
defaultInitSize
|
private int[] |
elems
|
private int |
initSize
|
private int |
lastElementIndex
|
Constructor Summary | |
---|---|
IntList()
|
Method Summary | |
---|---|
boolean |
add(int elem)
Adds an element to the end of IIntList. |
void |
clear()
Clears all elements from the list. |
boolean |
contains(int elem)
Returns whether list contains element elem |
int |
get(int idx)
Gets i-th element from the list. |
boolean |
isEmpty()
Returns true if there are no elements in the list, false if there is at least one element in the list |
int |
numberOfElements()
Returns number of the elements contained in this list. |
int |
removeLast()
Removes last element from the IIntList. |
int |
set(int idx,
int elem)
Sets i-th element of the list to value elem . |
int[] |
toArray()
Returns array representation of IntList elements |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int defaultInitSize
private int initSize
private int[] elems
private int lastElementIndex
Constructor Detail |
---|
public IntList()
Method Detail |
---|
public int numberOfElements()
IIntList
numberOfElements
in interface IIntList
public boolean isEmpty()
IIntList
isEmpty
in interface IIntList
public boolean contains(int elem)
IIntList
elem
contains
in interface IIntList
public int[] toArray()
IIntList
toArray
in interface IIntList
public boolean add(int elem)
IIntList
add
in interface IIntList
public int removeLast()
IIntList
removeLast
in interface IIntList
public void clear()
IIntList
clear
in interface IIntList
public int get(int idx)
IIntList
Number of elements in the list can be obtained by invoking
numberOfElements()
.
get
in interface IIntList
public int set(int idx, int elem)
IIntList
elem
. This
operation can be successfully carried out only if the index of the object
is smaller then the number of the elements in the list. Otherwise, the
results are unpredictable.
Number of elements in the list can be obtained by invoking
numberOfElements()
.
set
in interface IIntList
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |