64 lines
1.6 KiB
Java
64 lines
1.6 KiB
Java
/*
|
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
|
*/
|
|
package appComune;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
import java.util.Date;
|
|
|
|
/**
|
|
*
|
|
* @author Verde
|
|
*/
|
|
public class Anagrafica {
|
|
|
|
String nome;
|
|
String cognome;
|
|
Date dataNascita;
|
|
String luogoNascita;
|
|
String sesso;
|
|
String CF;
|
|
|
|
public Anagrafica(String nome, String cognome, Date dataNascita, String luogo, String sesso) {
|
|
this.nome = nome;
|
|
this.cognome = cognome;
|
|
this.dataNascita = dataNascita;
|
|
this.luogoNascita = luogo;
|
|
this.sesso = sesso;
|
|
this.CF = GestisciCodiceFiscale.CalcolaCodiceFiscale(nome, cognome, dataNascita, luogo, sesso);
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
SimpleDateFormat sdf = new SimpleDateFormat(MainComune.PATTERN_DATA);
|
|
return "Nome: " + this.getNome() + "\nCognome: " + this.getCognome() + "\nData di nascita: "
|
|
+ sdf.format(this.getDataNascita()) + "\nLuogo di nascita: " + this.getLuogoNascita() + "\nSesso: " + this.getSesso()
|
|
+ "\nCodice fiscale: " + this.getCF();
|
|
}
|
|
|
|
public String getNome() {
|
|
return nome;
|
|
}
|
|
|
|
public String getCognome() {
|
|
return cognome;
|
|
}
|
|
|
|
public Date getDataNascita() {
|
|
return dataNascita;
|
|
}
|
|
|
|
public String getLuogoNascita() {
|
|
return luogoNascita;
|
|
}
|
|
|
|
public String getSesso() {
|
|
return sesso;
|
|
}
|
|
|
|
public String getCF() {
|
|
return CF;
|
|
}
|
|
} |