ae…
tem alguma collection ou map que inclui objetos em ordem, sem eu precisar fazer metodos para incluir, excluir, etc em ordem?
o objeto que eu quero manipular é esse:
[code]public class Contato {
private String telefone ="",
nome = "",
endereco ="",
email = "";
private StringBuffer anotacoes = null;
public Contato(String tel, String nom)
{ this.telefone = tel;
this.nome = nom;
}
public Contato(String tel, String nom, String ema)
{ this.telefone = tel;
this.nome = nom;
this.email = ema;
}
public Contato(String tel, String nom, String ema, String end)
{ this.telefone = tel;
this.nome = nom;
this.email = ema;
this.endereco = end;
}
public Contato(String tel, String nom, String ema, String end, StringBuffer anotac)
{ this.telefone = tel;
this.nome = nom;
this.email = ema;
this.endereco = end;
this.anotacoes = anotac;
}
public String getTelefone()
{ return this.telefone;
}
public String getNome()
{ return this.nome;
}
public String getEmail()
{ return this.email;
}
public String getEndereco()
{ return this.endereco;
}
public StringBuffer getAnotacoes()
{ return this.anotacoes;
}
public void setTelefone(String tel)
{ this.telefone = tel;
}
public void setNome(String tel)
{ this.nome = tel;
}
public void setEmail(String tel)
{ this.email = tel;
}
public void setEndereco(String tel)
{ this.telefone = tel;
}
public void setAnotacoes(StringBuffer anotac)
{ this.anotacoes = anotac;
}
public int compareTo(Contato cont )
{
return this.telefone.compareTo(cont.telefone);
}
}
[/code]
agradeço ja a ajuda…
estou fazendo uma agenda virtual…