KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > mail > Address


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the "License"). You may not use this file except
5  * in compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * glassfish/bootstrap/legal/CDDLv1.0.txt or
9  * https://glassfish.dev.java.net/public/CDDLv1.0.html.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * HEADER in each file and include the License file at
15  * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable,
16  * add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your
18  * own identifying information: Portions Copyright [yyyy]
19  * [name of copyright owner]
20  */

21
22 /*
23  * @(#)Address.java 1.9 05/08/29
24  *
25  * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
26  */

27
28 package javax.mail;
29
30 import java.io.Serializable JavaDoc;
31
32 /**
33  * This abstract class models the addresses in a message.
34  * Subclasses provide specific implementations. Subclasses
35  * will typically be serializable so that (for example) the
36  * use of Address objects in search terms can be serialized
37  * along with the search terms.
38  *
39  * @author John Mani
40  * @author Bill Shannon
41  */

42
43 public abstract class Address implements Serializable JavaDoc {
44
45     private static final long serialVersionUID = -5822459626751992278L;
46
47     /**
48      * Return a type string that identifies this address type.
49      *
50      * @return address type
51      * @see javax.mail.internet.InternetAddress
52      */

53     public abstract String JavaDoc getType();
54
55     /**
56      * Return a String representation of this address object.
57      *
58      * @return string representation of this address
59      */

60     public abstract String JavaDoc toString();
61
62     /**
63      * The equality operator. Subclasses should provide an
64      * implementation of this method that supports value equality
65      * (do the two Address objects represent the same destination?),
66      * not object reference equality. A subclass must also provide
67      * a corresponding implementation of the <code>hashCode</code>
68      * method that preserves the general contract of
69      * <code>equals</code> and <code>hashCode</code> - objects that
70      * compare as equal must have the same hashCode.
71      *
72      * @param address Address object
73      */

74     public abstract boolean equals(Object JavaDoc address);
75 }
76
Popular Tags