public final class ReadOnlyVecInt extends Object implements IVecInt
Constructor and Description |
---|
ReadOnlyVecInt(IVecInt vec) |
Modifier and Type | Method and Description |
---|---|
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) |
boolean |
equals(Object obj) |
int |
get(int i) |
void |
growTo(int newsize,
int pad) |
int |
hashCode() |
int |
indexOf(int e) |
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(int sourceStartingIndex,
int[] dest) |
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() |
VecInt[] |
subset(int cardinal)
Compute all subsets of cardinal k of the vector.
|
int[] |
toArray()
Allow to access the internal representation of the vector as an array.
|
String |
toString() |
int |
unsafeGet(int eleem) |
void |
unsafePush(int elem)
Push the element in the Vector without verifying if there is room for it.
|
public ReadOnlyVecInt(IVecInt vec)
public int containsAt(int e)
IVecInt
containsAt
in interface IVecInt
e
- an integerpublic int containsAt(int e, int from)
IVecInt
containsAt
in interface IVecInt
e
- an integerfrom
- the index to start from (excluded).public void copyTo(IVecInt copy)
IVecInt
public int delete(int i)
IVecInt
public void insertFirst(int elem)
IVecInt
insertFirst
in interface IVecInt
elem
- the element to put first in the vector.public boolean isEmpty()
IVecInt
public IteratorInt iterator()
public void moveTo(int dest, int source)
IVecInt
vec[dest] = vec[source]
public IVecInt pop()
IVecInt
public void remove(int elem)
IVecInt
public void shrink(int nofelems)
IVecInt
public void sortUnique()
sortUnique
in interface IVecInt
public void unsafePush(int elem)
IVecInt
unsafePush
in interface IVecInt
public int[] toArray()
IVecInt
public void moveTo(int sourceStartingIndex, int[] dest)
public VecInt[] subset(int cardinal)
IVecInt
Copyright © 2013 Centre de Recherche en Informatique de Lens (CRIL). All Rights Reserved.