Boa tarde,
Está correto considerar esse método como polimorfismo?
//MÉTODO LOCALIZAR FUNCIONARIO
public boolean localizar(String cFuncionario, String nomeProcurado) {
try {
BufferedReader br = new BufferedReader(new FileReader(cFuncionario));
int cont = 0;
while (br.ready()) {
String linha = br.readLine();
String arrayNome[] = linha.split("&");
if (arrayNome[0].equalsIgnoreCase(nomeProcurado)) {
cont++;
}
}
br.close();
if (cont == 0) {
this.msErro = "Funcionário não localizado";
return false;
}
} catch (Exception e) {
this.msErro = "Erro de Exception:" + e.toString();
}
return true;
}
// MÉTODO LOCALIZAR CADASTRO DE TODAS AS FICHAS (FUNCIONARIO E CLIENTE)
public boolean localizar(String cFuncionario, String cCliente, String nomeProcurado) {
try {
BufferedReader brF = new BufferedReader(new FileReader(cFuncionario));
BufferedReader brC = new BufferedReader(new FileReader(cCliente));
int cont = 0;
while (brF.ready()) {
String linha = brF.readLine();
String arrayNome[] = linha.split("&");
if (arrayNome[0].equalsIgnoreCase(nomeProcurado)) {
cont++;
}
}
brF.close();
while (brC.ready()) {
String linha = brC.readLine();
String arrayNome[] = linha.split("&");
if (arrayNome[0].equalsIgnoreCase(nomeProcurado)) {
cont++;
}
}
brC.close();
if (cont == 0) {
this.msErro = "Clinte não localizado";
return false;
}
} catch (Exception e) {
this.msErro = "Erro de Exception:" + e.toString();
}
return true;
}