1234567891011121314151617181920212223242526272829303132333435363738 |
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-
- package kontakte.model;
-
- import java.util.HashMap;
-
- /**
- * Die Datenschicht der Anwendung. Es wird eine HasMap mit Kontakten verwaltet.
- *
- * @see Kontakt
- */
- public class Model
- {
- public HashMap<String, Kontakt> kontaktliste;
- public Model()
- {
- kontaktliste = new HashMap<>();
- }
-
- public void addKontakt(Kontakt k)
- {
- kontaktliste.put(k.name, k);
- }
-
- public void deleteKontakt(Kontakt k)
- {
- kontaktliste.remove(k.name);
- }
-
- public Kontakt getKontakt(String name)
- {
- return kontaktliste.get(name);
- }
- }
|