|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuiton.util.MatrixMap.Vector<E>
public static class MatrixMap.Vector<E>
Permet de stocker des données à une position lineaire et de la redemander. Cette classe ne gére que les données lineaire. L'avantage de cette classe est de ne conserver que les elements differents de la valeur par defaut, ce qui minimize la taille du tableau necessaire a conserver les données.
| Field Summary | |
|---|---|
protected int |
capacity
maximum number of element, maximum pos value |
protected ArrayList<E> |
data
contient la valeur de l'element |
protected E |
defaultValue
la valeur par defaut |
protected int[] |
position
contient la position de l'element, le tableau est trie |
protected int |
positionSize
|
| Constructor Summary | |
|---|---|
MatrixMap.Vector(int capacity)
|
|
MatrixMap.Vector(int capacity,
E defaultValue)
|
|
| Method Summary | |
|---|---|
protected void |
addElementAt(int index,
int element)
|
protected void |
checkPos(int pos)
|
protected void |
ensureCapacity(int mincap)
|
boolean |
equals(Object o)
|
protected int |
findIndex(int pos)
retourne la position dans le tableau position de la position lineaire |
E |
getMaxOccurrence()
|
E |
getValue(int pos)
|
void |
map(MatrixMap.MapFunction<E> f)
on applique sur chaque donnée existante et sur default |
void |
paste(MatrixMap.Vector<E> v)
On recopie tous les attributs pour que le vector ressemble exactement a celui passé en argument |
protected int |
removeElementAt(int index)
|
void |
setValue(int pos,
E value)
|
int |
size()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int capacity
protected E defaultValue
protected int[] position
protected int positionSize
protected ArrayList<E> data
| Constructor Detail |
|---|
public MatrixMap.Vector(int capacity)
public MatrixMap.Vector(int capacity,
E defaultValue)
| Method Detail |
|---|
public int size()
public E getMaxOccurrence()
protected void checkPos(int pos)
public E getValue(int pos)
public void setValue(int pos,
E value)
public boolean equals(Object o)
equals in class Objectprotected int findIndex(int pos)
pos -
protected void ensureCapacity(int mincap)
protected void addElementAt(int index,
int element)
protected int removeElementAt(int index)
public void paste(MatrixMap.Vector<E> v)
public void map(MatrixMap.MapFunction<E> f)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||