1 /*
2 * (C) 2002 David Carr david@carr.name
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19 package net.sourceforge.mflow.impl;
20
21 import java.util.ArrayList;
22 import java.util.List;
23
24 import net.sourceforge.mflow.api.Contact;
25 import net.sourceforge.mflow.api.ContactGroup;
26 import net.sourceforge.mflow.api.ContactManager;
27
28 /***
29 * Manager for the Contacts
30 *
31 * @author <a href="mailto:david@carr.name">David Carr</a>
32 * @version $Revision: 1.3 $
33 */
34 public class ContactManagerImpl implements ContactManager {
35 private List instances = new ArrayList();
36 private ContactGroup contactGroup = new ContactGroupImpl();
37 private Contact identity = new ContactImpl();
38
39 ContactManagerImpl() {
40 //No arguments needed
41 }
42
43 public synchronized Contact[] getInstances() {
44 return (Contact[]) this.instances.toArray(
45 new Contact[this.instances.size()]);
46 }
47
48 public synchronized Contact newInstance() {
49 Contact c = new ContactImpl();
50 this.instances.add(c);
51 return c;
52 }
53
54 public ContactGroup getContactGroup() {
55 return this.contactGroup;
56 }
57
58 public void setContactGroup(ContactGroup cg) {
59 this.contactGroup = cg;
60 }
61
62 public Contact getIdentity() {
63 return this.identity;
64 }
65
66 public void setIdentity(Contact identity) {
67 this.identity = identity;
68 }
69 }
This page was automatically generated by Maven