DEV 3.2 ; TP01
This commit is contained in:
31
DEV 3.2/TP01/Association/Association.java
Normal file
31
DEV 3.2/TP01/Association/Association.java
Normal file
@@ -0,0 +1,31 @@
|
||||
public class Association<T> {
|
||||
private T element;
|
||||
private int frequency;
|
||||
|
||||
|
||||
public Association(T e, int f) {
|
||||
this.element = e;
|
||||
this.frequency = f;
|
||||
}
|
||||
|
||||
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 + "]";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user