arch
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
package totale.p240116;
|
||||
|
||||
public class Docente implements Comparable<Docente>{
|
||||
|
||||
// Variables
|
||||
private String ORCID;
|
||||
private String nome;
|
||||
private String cognome;
|
||||
private int eta;
|
||||
|
||||
// Constructor
|
||||
public Docente(
|
||||
String ORCID,
|
||||
String nome,
|
||||
String cognome,
|
||||
int eta) {
|
||||
this.ORCID = ORCID;
|
||||
this.nome = nome;
|
||||
this.cognome = cognome;
|
||||
this.eta = eta;
|
||||
}
|
||||
|
||||
// Getter
|
||||
public String ORCID() {
|
||||
return ORCID;
|
||||
}
|
||||
|
||||
public String nome() {
|
||||
return nome;
|
||||
}
|
||||
|
||||
public String cognome() {
|
||||
return cognome;
|
||||
}
|
||||
|
||||
public int eta() {
|
||||
return eta;
|
||||
}
|
||||
|
||||
// Equals
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null) return false;
|
||||
if (obj == this) return true;
|
||||
if (!(obj instanceof Docente)) return false;
|
||||
|
||||
Docente docente = (Docente) obj;
|
||||
|
||||
return this.ORCID.equals(docente.ORCID);
|
||||
}
|
||||
|
||||
// Comparable
|
||||
@Override
|
||||
public int compareTo(Docente docente) {
|
||||
return this.ORCID.compareTo(docente.ORCID);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user