org.sat4j.specs
Interface IVecInt

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
ReadOnlyVecInt, VecInt

public interface IVecInt
extends java.io.Serializable

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

Author:
leberre

Method Summary
 void clear()
           
 boolean contains(int e)
           
 int containsAt(int e)
          returns the index of the first occurrence of e, else -1.
 int containsAt(int e, int from)
          returns the index of the first occurence of e occurring after from (excluded), else -1.
 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
 IteratorInt iterator()
           
 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[] toArray()
          Allow to access the internal representation of the vector as an array.
 int unsafeGet(int eleem)
           
 void unsafePush(int elem)
          Push the element in the Vector without verifying if there is room for it.
 

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)

containsAt

int containsAt(int e)
returns the index of the first occurrence of e, else -1.

Parameters:
e - an integer
Returns:
the index i such that get(i)==e, else -1.

containsAt

int containsAt(int e,
               int from)
returns the index of the first occurence of e occurring after from (excluded), else -1.

Parameters:
e - an integer
from - the index to start from (excluded).
Returns:
the index i such that i>from and get(i)==e, else -1

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

iterator

IteratorInt iterator()

toArray

int[] toArray()
Allow to access the internal representation of the vector as an array. Note that only the content of index 0 to size() should be taken into account. USE WITH CAUTION

Returns:
the internal representation of the Vector as an array.


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