58 lines
932 B
Java
58 lines
932 B
Java
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);
|
|
}
|
|
|
|
}
|