korat.utils
Class IntListBS

java.lang.Object
  extended by korat.utils.IntList
      extended by korat.utils.IntListBS
All Implemented Interfaces:
IIntList

public class IntListBS
extends IntList

Uses bitset to check if field is already contained.

Author:
Sasa Misailovic List of integers with stack access policy

Field Summary
private  BitSet bs
           
 
Constructor Summary
IntListBS()
           
IntListBS(int initSize)
           
 
Method Summary
 boolean add(int arg0)
          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 removeLast()
          Removes last element from the IIntList.
 int set(int index, int elem)
          Sets i-th element of the list to value elem.
 
Methods inherited from class korat.utils.IntList
get, isEmpty, numberOfElements, toArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bs

private BitSet bs
Constructor Detail

IntListBS

public IntListBS()

IntListBS

public IntListBS(int initSize)
Method Detail

contains

public boolean contains(int elem)
Description copied from interface: IIntList
Returns whether list contains element elem

Specified by:
contains in interface IIntList
Overrides:
contains in class IntList

add

public boolean add(int arg0)
Description copied from interface: IIntList
Adds an element to the end of IIntList. New elements can always be added to IIntList

Specified by:
add in interface IIntList
Overrides:
add in class IntList

removeLast

public int removeLast()
Description copied from interface: IIntList
Removes last element from the IIntList. This operation can be successfully carried out only if the list is not empty.

Specified by:
removeLast in interface IIntList
Overrides:
removeLast in class IntList

clear

public void clear()
Description copied from interface: IIntList
Clears all elements from the list.

Specified by:
clear in interface IIntList
Overrides:
clear in class IntList

set

public int set(int index,
               int elem)
Description copied from interface: IIntList
Sets i-th element of the list to value 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().

Specified by:
set in interface IIntList
Overrides:
set in class IntList