new files added.
This commit is contained in:
parent
1becf1ce11
commit
cf5b866efa
|
|
@ -0,0 +1,123 @@
|
||||||
|
|
||||||
|
public class Jogador {
|
||||||
|
int id;
|
||||||
|
String nome;
|
||||||
|
int altura;
|
||||||
|
int peso;
|
||||||
|
String universidade;
|
||||||
|
int anoNascimento;
|
||||||
|
String cidadeNascimento;
|
||||||
|
String estadoNascimento;
|
||||||
|
|
||||||
|
public Jogador() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public Jogador(String linha) {
|
||||||
|
String campos[] = linha.split(",");
|
||||||
|
this.id = Integer.parseInt(campos[0]);
|
||||||
|
this.nome = campos[1];
|
||||||
|
this.altura = Integer.parseInt(campos[2]);
|
||||||
|
this.peso = Integer.parseInt(campos[3]);
|
||||||
|
this.universidade = (campos[4].isEmpty()) ? "nao informado" : campos[4];
|
||||||
|
this.anoNascimento = Integer.parseInt(campos[5]);
|
||||||
|
if (campos.length > 6) {
|
||||||
|
this.cidadeNascimento = (campos[6].isEmpty())? "nao informado": campos[6];
|
||||||
|
if (campos.length < 8) {
|
||||||
|
this.estadoNascimento = "nao informado";
|
||||||
|
} else {
|
||||||
|
this.estadoNascimento = campos[7];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.cidadeNascimento = "nao informado";
|
||||||
|
this.estadoNascimento = "nao informado";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// id,Player,height,weight,collage,born,birth_city,birth_state
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(int id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNome() {
|
||||||
|
return nome;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNome(String nome) {
|
||||||
|
this.nome = nome;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getAltura() {
|
||||||
|
return altura;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAltura(int altura) {
|
||||||
|
this.altura = altura;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPeso() {
|
||||||
|
return peso;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPeso(int peso) {
|
||||||
|
this.peso = peso;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAnoNascimento(int anoNascimento){
|
||||||
|
this.anoNascimento = anoNascimento;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getAnoNascimento(){
|
||||||
|
return anoNascimento;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUniversidade() {
|
||||||
|
return universidade;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUniversidade(String universidade) {
|
||||||
|
this.universidade = universidade;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCidadeNascimento() {
|
||||||
|
return cidadeNascimento;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCidadeNascimento(String cidadeNascimento) {
|
||||||
|
this.cidadeNascimento = cidadeNascimento;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEstadoNascimento() {
|
||||||
|
return estadoNascimento;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEstadoNascimetno(String estadoNascimento) {
|
||||||
|
this.estadoNascimento = estadoNascimento;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Jogador clone() {
|
||||||
|
Jogador novo = new Jogador();
|
||||||
|
novo.id = this.id;
|
||||||
|
novo.nome = this.nome;
|
||||||
|
novo.altura = this.altura;
|
||||||
|
novo.peso = this.peso;
|
||||||
|
novo.universidade = this.universidade;
|
||||||
|
novo.cidadeNascimento = this.cidadeNascimento;
|
||||||
|
novo.estadoNascimento = this.estadoNascimento;
|
||||||
|
return novo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void imprimir() {
|
||||||
|
System.out.println("## " + nome + " ## " + altura + " ## " + peso + " ## " + anoNascimento + " ## "
|
||||||
|
+ universidade + " ## " + cidadeNascimento + " ## " + estadoNascimento + " ##");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toString() {
|
||||||
|
return "[" + id + " ## " + nome + " ## " + altura + " ## " + peso + " ## " + anoNascimento + " ## "
|
||||||
|
+ universidade + " ## " + cidadeNascimento + " ## " + estadoNascimento + "]";
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue