org.sat4j.specs
Interface IVecInt

All Superinterfaces:
java.lang.Iterable<java.lang.Integer>
All Known Implementing Classes:
VecInt

public interface IVecInt
extends java.lang.Iterable<java.lang.Integer>

An abstraction for the vector of int used on the library.

Author:
leberre

Method Summary
 void clear()
           
 boolean contains(int e)
           
 void copyTo(int[] is)
           
 void copyTo(IVecInt copy)
          C'est operations devraient se faire en temps constant.
 int delete(int i)
          Delete the ith element of the vector.
 void ensure(int nsize)
           
 int get(int i)
           
 void growTo(int newsize, int pad)
           
 void insertFirst(int elem)
          Insert an element at the very begining of the vector.
 boolean isEmpty()
          To know if a vector is empty
 int last()
           
 void moveTo(int[] dest)
           
 void moveTo(int dest, int source)
          Move elements inside the vector.
 void moveTo(IVecInt dest)
           
 void moveTo2(IVecInt dest)
           
 IVecInt pop()
          depile le dernier element du vecteur.
 IVecInt push(int elem)
           
 void remove(int elem)
          Enleve un element qui se trouve dans le vecteur!!!
 void set(int i, int o)
           
 void shrink(int nofelems)
          Remove the latest nofelems elements from the vector
 void shrinkTo(int newsize)
           
 int size()
           
 void sort()
           
 void sortUnique()
           
 int unsafeGet(int eleem)
           
 void unsafePush(int elem)
          Push the element in the Vector without verifying if there is room for it.
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

size

int size()

shrink

void shrink(int nofelems)
Remove the latest nofelems elements from the vector

Parameters:
nofelems -

shrinkTo

void shrinkTo(int newsize)

pop

IVecInt pop()
depile le dernier element du vecteur. Si le vecteur est vide, ne fait rien.


growTo

void growTo(int newsize,
            int pad)

ensure

void ensure(int nsize)

push

IVecInt push(int elem)

unsafePush

void unsafePush(int elem)
Push the element in the Vector without verifying if there is room for it. USE WITH CAUTION!

Parameters:
elem -

unsafeGet

int unsafeGet(int eleem)

clear

void clear()

last

int last()

get

int get(int i)

set

void set(int i,
         int o)

contains

boolean contains(int e)

copyTo

void copyTo(IVecInt copy)
C'est operations devraient se faire en temps constant. Ce n'est pas le cas ici.

Parameters:
copy -

copyTo

void copyTo(int[] is)
Parameters:
is -

moveTo

void moveTo(IVecInt dest)

moveTo2

void moveTo2(IVecInt dest)

moveTo

void moveTo(int[] dest)

moveTo

void moveTo(int dest,
            int source)
Move elements inside the vector. The content of the method is equivalent to: vec[dest] = vec[source]

Parameters:
dest - the index of the destination
source - the index of the source

insertFirst

void insertFirst(int elem)
Insert an element at the very begining of the vector. The former first element is appended to the end of the vector in order to have a constant time operation.

Parameters:
elem - the element to put first in the vector.

remove

void remove(int elem)
Enleve un element qui se trouve dans le vecteur!!!

Parameters:
elem - un element du vecteur

delete

int delete(int i)
Delete the ith element of the vector. The latest element of the vector replaces the removed element at the ith indexer.

Parameters:
i - the indexer of the element in the vector
Returns:
the former ith element of the vector that is now removed from the vector

sort

void sort()

sortUnique

void sortUnique()

isEmpty

boolean isEmpty()
To know if a vector is empty

Returns:
true iff the vector is empty.
Since:
1.6


Copyright © 2007 Centre de Recherche en Informatique de Lens (CRIL). All Rights Reserved.