|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.sat4j.core.Vec<T>
public class Vec<T>
Simple but efficient vector implementation, based on the vector implementation available in MiniSAT.
Constructor Summary | |
---|---|
Vec()
|
|
Vec(int size)
|
|
Vec(int size,
T pad)
Construit un vecteur contenant de taille size rempli � l'aide de size pad. |
Method Summary | ||
---|---|---|
void |
clear()
|
|
|
copyTo(E[] dest)
|
|
void |
copyTo(IVec<T> copy)
Ces op�rations devraient se faire en temps constant. |
|
static
|
defaultComparator()
|
|
T |
delete(int i)
Delete the ith element of the vector. |
|
void |
ensure(int nsize)
|
|
boolean |
equals(java.lang.Object obj)
|
|
T |
get(int i)
|
|
void |
growTo(int newsize,
T pad)
|
|
int |
hashCode()
|
|
void |
insertFirst(T elem)
Insert an element at the very begining of the vector. |
|
void |
insertFirstWithShifting(T elem)
|
|
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(T elem)
|
|
void |
remove(T elem)
Enleve un element qui se trouve dans le vecteur!!! |
|
void |
set(int i,
T 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> cmp)
|
|
java.lang.String |
toString()
|
|
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 |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Vec()
public Vec(int size)
public Vec(int size, T pad)
size
- la taille du vecteurpad
- l'objet servant � remplir le vecteurMethod Detail |
---|
public int size()
size
in interface IVec<T>
public void shrink(int nofelems)
shrink
in interface IVec<T>
nofelems
- the number of elements to remove.public void shrinkTo(int newsize)
shrinkTo
in interface IVec<T>
newsize
- the new size of the vector.public void pop()
pop
in interface IVec<T>
public void growTo(int newsize, T pad)
growTo
in interface IVec<T>
public final void ensure(int nsize)
ensure
in interface IVec<T>
public IVec<T> push(T elem)
push
in interface IVec<T>
public void unsafePush(T elem)
IVec
unsafePush
in interface IVec<T>
public void insertFirst(T elem)
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 void clear()
clear
in interface IVec<T>
public T last()
last
in interface IVec<T>
public T get(int i)
get
in interface IVec<T>
public void set(int i, T o)
set
in interface IVec<T>
public void remove(T elem)
remove
in interface IVec<T>
elem
- un element du vecteurpublic T delete(int i)
delete
in interface IVec<T>
i
- the indexer of the element in the vector
public void copyTo(IVec<T> copy)
copyTo
in interface IVec<T>
copy
- public <E> void copyTo(E[] dest)
copyTo
in interface IVec<T>
dest
- 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 java.lang.String toString()
toString
in class java.lang.Object
public void sort(java.util.Comparator<T> comparator)
sort
in interface IVec<T>
comparator
- public void sortUnique(java.util.Comparator<T> cmp)
sortUnique
in interface IVec<T>
public static final <A extends java.lang.Comparable<A>> java.util.Comparator<A> defaultComparator()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.util.Iterator<T> iterator()
iterator
in interface java.lang.Iterable<T>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |