T
- the type of the container.public final class ReadOnlyVec<T> extends Object implements IVec<T>
Constructor and Description |
---|
ReadOnlyVec(IVec<T> vec) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
contains(T element) |
<E> void |
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) |
boolean |
equals(Object obj) |
T |
get(int i) |
void |
growTo(int newsize,
T pad) |
int |
hashCode() |
int |
indexOf(T element) |
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
|
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(Comparator<T> comparator) |
void |
sortUnique(Comparator<T> comparator) |
T[] |
toArray()
Allow to access the internal representation of the vector as an array.
|
String |
toString() |
void |
unsafePush(T elem)
To push an element in the vector when you know you have space for it.
|
public void copyTo(IVec<T> copy)
IVec
public T delete(int i)
IVec
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
public T last()
IVec
public void moveTo(IVec<T> dest)
IVec
public void moveTo(int dest, int source)
IVec
vec[dest] = vec[source]
public void pop()
IVec
public void remove(T elem)
IVec
public void shrink(int nofelems)
IVec
public void shrinkTo(int newsize)
IVec
public int size()
public void sort(Comparator<T> comparator)
public void sortUnique(Comparator<T> comparator)
sortUnique
in interface IVec<T>
public T[] toArray()
IVec
public void unsafePush(T elem)
IVec
unsafePush
in interface IVec<T>
public boolean contains(T element)
public int indexOf(T element)
Copyright © 2013 Centre de Recherche en Informatique de Lens (CRIL). All Rights Reserved.