public class LazyVector extends Object implements Vector
| Modifier and Type | Class and Description |
|---|---|
protected class |
LazyVector.DummyVectorIterator
Iterator qui retourne toujours la meme valeur un certain nombre de fois
|
protected class |
LazyVector.LazyVectorIterator
Iterator qui prepare le backend que lors d'un set
|
| Modifier and Type | Field and Description |
|---|---|
protected Vector |
backend
reel backend, not initialized since not necessary
|
protected int |
capacity |
protected boolean |
isInitBackend |
protected AtomicInteger |
users |
| Constructor and Description |
|---|
LazyVector(Vector backend)
Create new lazy, with initialized backend
|
LazyVector(Vector backend,
int capacity)
Create new lazy with not initialized backend
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(Vector v)
Ajoute les valeurs du vector passé en argument a ce vector.
|
boolean |
equals(Object o) |
String |
getInfo()
return information on this vector.
|
double |
getMaxOccurence() |
double |
getMaxOccurrence()
Retourne la valeur la plus utilise dans le vector
|
int |
getNumberOfAssignedValue()
Returne number of assigned value, assigned value is value stored in memory
|
double |
getValue(int pos) |
int |
hashCode() |
void |
init(int capacity)
Init vector, before this method call, vector is in indetermined state.
|
boolean |
isImplementedAdd(Vector v)
Permet de savoir si add est implanté par ce vector.
|
boolean |
isImplementedMap()
Permet de savoir si map est implanté par ce vector.
|
boolean |
isImplementedMinus(Vector v)
Permet de savoir si minus est implanté par ce vector.
|
boolean |
isImplementedPaste(Vector v)
Permet de savoir si paste est implanté par ce vector.
|
VectorIterator |
iterator()
Retourne un objet Inc pret a etre utilisé pour boucler sur tous les
element de la matrice.
|
VectorIterator |
iteratorNotZero()
Retourne un objet Inc pret a etre utilisé pour boucler sur tous les
element different de 0 de la matrice.
|
void |
map(MapFunction f)
applique a chaque valeur du vector la
MapFunction. |
void |
minus(Vector v)
Soustrait les valeurs du vector passé en argument a ce vector.
|
void |
paste(Vector source)
Copie les valeurs du vector passé en argument dans ce vector.
|
protected void |
pasteToBackend(Vector target,
Vector copy)
Before call this method backend, must be initialized
|
protected void |
prepareBackendForModification() |
void |
setValue(int pos,
double value) |
int |
size() |
protected boolean isInitBackend
protected Vector backend
protected AtomicInteger users
protected int capacity
public LazyVector(Vector backend)
backend - public LazyVector(Vector backend, int capacity)
backend - capacity - public void init(int capacity)
Vectorpublic String getInfo()
Vectorpublic int getNumberOfAssignedValue()
VectorgetNumberOfAssignedValue in interface Vectorpublic double getMaxOccurence()
getMaxOccurence in interface Vectorpublic double getMaxOccurrence()
VectorgetMaxOccurrence in interface Vectorpublic boolean isImplementedPaste(Vector v)
VectorisImplementedPaste in interface Vectorv - vector to testpublic boolean isImplementedAdd(Vector v)
VectorisImplementedAdd in interface Vectorv - vector to testpublic boolean isImplementedMinus(Vector v)
VectorisImplementedMinus in interface Vectorv - vector to testpublic boolean isImplementedMap()
VectorisImplementedMap in interface Vectorpublic void paste(Vector source)
Vectorpublic void add(Vector v)
Vectorpublic void minus(Vector v)
Vectorpublic void map(MapFunction f)
VectorMapFunction.
ATTENTION cette function ne doit pas converser d'etat interne qui
modifierait son comportement a chaque execution, sinon cette methode
ne fonctionne pas, car pour les Vector implanter a base de Map
la fonction n'est appliqué qu'au defaultValue et au valeur deja existanteprotected void prepareBackendForModification()
protected void pasteToBackend(Vector target, Vector copy)
target - copy - public VectorIterator iterator()
Vectorpublic VectorIterator iteratorNotZero()
VectoriteratorNotZero in interface VectorCopyright © 2004–2015 CodeLutin. All rights reserved.