|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectkorat.utils.IntListAI
public class IntListAI
List of integers with stack policy Different mechanism for checking if the field index is already contained in the accessed field list. This implementation should work faster than IntListBS, which uses java.util.BitSet to check for presence of value inside the list.
| Field Summary | |
|---|---|
(package private) int |
cnt
|
(package private) int[] |
cvelems
|
protected int[] |
elems
|
protected int |
lastElementIndex
|
| Constructor Summary | |
|---|---|
IntListAI(int candidateVectorSize)
|
|
| 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 |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected int[] elems
protected int lastElementIndex
int[] cvelems
int cnt
| Constructor Detail |
|---|
public IntListAI(int candidateVectorSize)
| Method Detail |
|---|
public boolean contains(int elem)
IIntListelem
contains in interface IIntListpublic boolean add(int elem)
IIntList
add in interface IIntListpublic int removeLast()
IIntList
removeLast in interface IIntListpublic void clear()
IIntList
clear in interface IIntList
public int set(int idx,
int elem)
IIntListelem. 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 IIntListpublic int numberOfElements()
IIntList
numberOfElements in interface IIntListpublic boolean isEmpty()
IIntList
isEmpty in interface IIntListpublic int get(int idx)
IIntList
Number of elements in the list can be obtained by invoking
numberOfElements().
get in interface IIntListpublic int[] toArray()
IIntList
toArray in interface IIntListpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||