KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > sync4j > syncclient > demo > DemoContact


1 /**
2  * Copyright (C) 2003-2005 Funambol
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 sync4j.syncclient.demo;
20
21 import sync4j.foundation.pdi.contact.Contact;
22
23 /**
24  * An object representing a contact.
25  * Each contact is identified by its filename
26  * and the contact itself in the form of a Contact object.
27  *
28  * @see sync4j.foundation.pdi.contact.Contact
29  *
30  * @author Fabio Maggi @ Funambol
31  * @author Alessandro Morandi, Giorgio Orsi
32  * @version $Id: DemoContact.java,v 1.4 2005/01/19 11:01:11 fabius Exp $
33  */

34 public class DemoContact {
35
36     //---------------------------------------------------------- Constants
37

38     //---------------------------------------------------------- Private data
39

40     private Contact contact = null ;
41     private String JavaDoc filename = null ;
42     private int type = 0 ;
43
44     //---------------------------------------------------------- Public methods
45

46     /**
47      * Creates a new contact without a specified type
48      *
49      * @param filename the filename for this contact
50      * @param contact the Contact object for this contact
51      */

52     public DemoContact(String JavaDoc filename, Contact contact) {
53         this.filename = filename;
54         this.contact = contact;
55         this.type = -1;
56     }
57
58     /**
59      * Creates a new contact
60      *
61      * @param filename the filename for this contact
62      * @param type the type for this contact
63      * @param contact the Contact object for this contact
64      */

65     public DemoContact(String JavaDoc filename, int type, Contact contact) {
66         this.filename = filename;
67         this.contact = contact;
68         this.type = type;
69     }
70
71     /**
72      * Returns the filename for this contact
73      *
74      * @return the filename for this contact
75      */

76     public String JavaDoc getFilename() {
77         return filename;
78     }
79
80     /**
81      * Returns the type for this contact
82      *
83      * @return the type for this contact
84      */

85     public int getType() {
86         return type;
87     }
88
89     /**
90      * Returns the Contact object for this contact
91      *
92      * @return the Contact object for this contact
93      */

94     public Contact getContact() {
95         return contact;
96     }
97
98     /**
99      * Sets the type of this contact
100      *
101      * @param type the type to set
102      */

103     public void setType(int type) {
104         this.type = type;
105     }
106
107     /**
108      * Sets the Contact objecy of this contact
109      *
110      * @param contact the Contact object to set
111      */

112     public void setContact(Contact contact) {
113         this.contact = contact;
114     }
115
116     //---------------------------------------------------------- Private methods
117
}
Popular Tags