|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.sat4j.core.ReadOnlyVec<T>
T
- the type of the container.public class ReadOnlyVec<T>
Utility class to allow Read Only access to an IVec
Constructor Summary | |
---|---|
ReadOnlyVec(IVec<T> vec)
|
Method Summary | ||
---|---|---|
void |
clear()
|
|
|
copyTo(E[] dest)
|
|
void |
copyTo(IVec<T> copy)
Ces operations devraient se faire en temps constant. |
|
T |
delete(int i)
Delete the ith element of the vector. |
|
void |
ensure(int nsize)
|
|
T |
get(int i)
|
|
void |
growTo(int newsize,
T pad)
|
|
void |
insertFirst(T elem)
Insert an element at the very begining of the vector. |
|
void |
insertFirstWithShifting(T elem)
|
|
boolean |
isEmpty()
To know if a vector is empty |
|
java.util.Iterator<T> |
iterator()
|
|
T |
last()
return the latest element on the stack. |
|
void |
moveTo(int dest,
int source)
Move elements inside the vector. |
|
void |
moveTo(IVec<T> dest)
Move the content of the vector into dest. |
|
void |
pop()
Pop the last element on the stack. |
|
IVec<T> |
push(java.lang.Object elem)
|
|
void |
remove(java.lang.Object elem)
Enleve un element qui se trouve dans le vecteur!!! |
|
void |
set(int i,
java.lang.Object o)
|
|
void |
shrink(int nofelems)
Remove nofelems from the Vector. |
|
void |
shrinkTo(int newsize)
reduce the Vector to exactly newsize elements |
|
int |
size()
|
|
void |
sort(java.util.Comparator<T> comparator)
|
|
void |
sortUnique(java.util.Comparator<T> comparator)
|
|
T[] |
toArray()
Allow to access the internal representation of the vector as an array. |
|
void |
unsafePush(T elem)
To push an element in the vector when you know you have space for it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReadOnlyVec(IVec<T> vec)
Method Detail |
---|
public void clear()
clear
in interface IVec<T>
public void copyTo(IVec<T> copy)
IVec
copyTo
in interface IVec<T>
public <E> void copyTo(E[] dest)
copyTo
in interface IVec<T>
public T delete(int i)
IVec
delete
in interface IVec<T>
i
- the indexer of the element in the vector
public void ensure(int nsize)
ensure
in interface IVec<T>
public T get(int i)
get
in interface IVec<T>
public void growTo(int newsize, T pad)
growTo
in interface IVec<T>
public void insertFirst(T elem)
IVec
insertFirst
in interface IVec<T>
elem
- the element to put first in the vector.public void insertFirstWithShifting(T elem)
insertFirstWithShifting
in interface IVec<T>
public boolean isEmpty()
IVec
isEmpty
in interface IVec<T>
public java.util.Iterator<T> iterator()
iterator
in interface IVec<T>
public T last()
IVec
last
in interface IVec<T>
public void moveTo(IVec<T> dest)
IVec
moveTo
in interface IVec<T>
dest
- the vector where top put the content of this vectorpublic void moveTo(int dest, int source)
IVec
vec[dest] = vec[source]
moveTo
in interface IVec<T>
dest
- the index of the destinationsource
- the index of the sourcepublic void pop()
IVec
pop
in interface IVec<T>
public IVec<T> push(java.lang.Object elem)
push
in interface IVec<T>
public void remove(java.lang.Object elem)
IVec
remove
in interface IVec<T>
elem
- un element du vecteurpublic void set(int i, java.lang.Object o)
set
in interface IVec<T>
public void shrink(int nofelems)
IVec
shrink
in interface IVec<T>
nofelems
- the number of elements to remove.public void shrinkTo(int newsize)
IVec
shrinkTo
in interface IVec<T>
newsize
- the new size of the vector.public int size()
size
in interface IVec<T>
public void sort(java.util.Comparator<T> comparator)
sort
in interface IVec<T>
public void sortUnique(java.util.Comparator<T> comparator)
sortUnique
in interface IVec<T>
public T[] toArray()
IVec
toArray
in interface IVec<T>
public void unsafePush(T elem)
IVec
unsafePush
in interface IVec<T>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |