You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Model.java 649B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package kontakte.model;
  7. import java.util.HashMap;
  8. /**
  9. *
  10. * @author nobody
  11. */
  12. public class Model
  13. {
  14. public HashMap<String, Kontakt> kontaktliste;
  15. public Model()
  16. {
  17. kontaktliste = new HashMap<>();
  18. }
  19. public void addKontakt(Kontakt k)
  20. {
  21. kontaktliste.put(k.name, k);
  22. }
  23. public void deleteKontakt(Kontakt k)
  24. {
  25. kontaktliste.remove(k.name);
  26. }
  27. public Kontakt getKontakt(String name)
  28. {
  29. return kontaktliste.get(name);
  30. }
  31. }