Skip to content

Instantly share code, notes, and snippets.

@DiegoAscanio
Created April 13, 2019 13:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DiegoAscanio/474bac118ad02a0756777bb70862f3c0 to your computer and use it in GitHub Desktop.
Save DiegoAscanio/474bac118ad02a0756777bb70862f3c0 to your computer and use it in GitHub Desktop.
public class Pessoa {
private String nome;
private Pessoa pai;
private Pessoa mae;
public Pessoa(String nome, Pessoa pai, Pessoa mae) {
this.nome = nome;
this.pai = pai;
this.mae = mae;
}
public boolean equals (Pessoa pessoa) {
String meuNome = this.nome;
Pessoa minhaMae = this.mae;
}
public boolean sãoIrmãs (Pessoa pessoa) {
Pessoa meuPai = this.pai;
Pessoa minhaMae = this.mae;
}
private boolean ePai (Pessoa pessoa) {
Pessoa meuPai = this.pai;
}
private boolean eMae (Pessoa pessoa) {
}
private boolean eAvoMaterna (Pessoa pessoa) {
Pessoa minhaMae = this.mae;
Pessoa minhaAvoMaterna = minhaMae.mae;
}
private boolean eAvoMaterno (Pessoa pessoa) {
}
private boolean eAvoPaterna (Pessoa pessoa) {
}
private boolean eAvoPaterno (Pessoa pessoa) {
}
public boolean eAntecessor (Pessoa pessoa) {
if (this.eMae(pessoa) == true ||
this.ePai(pessoa) == true ||
this.eAvoMaterna(pessoa) == true ||
this.eAvoMaterno(pessoa) == true ||
this.eAvoPaterna(pessoa) == true ||
this.eAvoPaterno(pessoa) == true ) {
return true;
}
else {
return false;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment