2022-10-05 11:07:41 +02:00
|
|
|
public class Association<T> {
|
|
|
|
private T element;
|
|
|
|
private int frequency;
|
|
|
|
|
2022-10-07 11:14:09 +02:00
|
|
|
private Association<T> suivant;
|
|
|
|
|
2022-10-05 11:07:41 +02:00
|
|
|
|
|
|
|
public Association(T e, int f) {
|
|
|
|
this.element = e;
|
|
|
|
this.frequency = f;
|
|
|
|
}
|
|
|
|
|
2022-10-07 11:14:09 +02:00
|
|
|
public Association<T> getSuivant() {
|
|
|
|
return suivant;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setSuivant(Association<T> suivant) {
|
|
|
|
this.suivant = suivant;
|
|
|
|
}
|
|
|
|
|
2022-10-05 11:07:41 +02:00
|
|
|
public void setElement(T e) {
|
|
|
|
this.element = e;
|
|
|
|
}
|
|
|
|
|
|
|
|
public T getElement() {
|
|
|
|
return this.element;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setFrequency(int f) {
|
|
|
|
this.frequency = f;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getFrequency() {
|
|
|
|
return this.frequency;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return "[" + this.element + ", " + this.frequency + "]";
|
|
|
|
}
|
|
|
|
}
|