1 package org.columba.addressbook.model; 19 20 import java.util.List ; 21 import java.util.Vector ; 22 23 27 public class GroupModelPartial extends BasicModelPartial implements IGroupModelPartial { 28 29 private List <IContactModelPartial> list = new Vector <IContactModelPartial>(); 30 31 34 public GroupModelPartial() { 35 super(false); 36 } 37 38 41 public GroupModelPartial(String id) { 42 super(id, false); 43 44 } 45 46 public GroupModelPartial(String id, String name, String description) { 47 this(id); 48 49 this.name = name; 50 this.description = description; 51 52 } 53 54 public List <IContactModelPartial> retrieveContacts() { 55 return list; 56 } 57 58 public void addContact(IContactModelPartial modelPartial) { 59 if ( modelPartial == null ) throw new IllegalArgumentException ("modelPartial == null"); 60 61 list.add(modelPartial); 62 } 63 64 public void removeContact(IContactModelPartial modelPartial) { 65 if ( modelPartial == null ) throw new IllegalArgumentException ("modelPartial == null"); 66 67 list.remove(modelPartial); 68 } 69 70 public int getContactCount() { 71 return list.size(); 72 } 73 74 } 75 | Popular Tags |