KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > tests > jfun > parsec > rfc822 > Address


1 /*
2  * Created on Dec 8, 2004
3  *
4  * Author Ben Yu
5  */

6 package tests.jfun.parsec.rfc822;
7
8 /**
9  * @author Ben Yu
10  *
11  * Dec 8, 2004
12  */

13 public class Address {
14   private final String JavaDoc[] phrase;
15   private final Mailbox[] mailboxes;
16   public String JavaDoc toString(){
17     if(phrase.length==0)
18       return ToString.printMailboxes(mailboxes);
19     else return ToString.printPhrase(phrase)
20       + ":" + ToString.printMailboxes(mailboxes)
21       + ";";
22   }
23   /**
24    * @param phrase
25    * @param mailboxes
26    */

27   public Address(final String JavaDoc[] phrase, final Mailbox[] mailboxes) {
28     this.phrase = phrase;
29     this.mailboxes = mailboxes;
30   }
31   /**
32    * @return Returns the mailboxes.
33    */

34   public Mailbox[] getMailboxes() {
35     return mailboxes;
36   }
37   /**
38    * @return Returns the phrase.
39    */

40   public String JavaDoc[] getPhrase() {
41     return phrase;
42   }
43 }
44
Popular Tags