javax.mail.internet
Class NewsAddress

java.lang.Object
  extended by javax.mail.Address
      extended by javax.mail.internet.NewsAddress
All Implemented Interfaces:
Serializable

public class NewsAddress
extends Address

A representation of an RFC1036 Internet newsgroup address.

Version:
$Rev: 467553 $ $Date: 2006-10-25 00:01:51 -0400 (Wed, 25 Oct 2006) $
See Also:
Serialized Form

Field Summary
protected  String host
          The host for this newsgroup
protected  String newsgroup
          The name of this newsgroup
 
Constructor Summary
NewsAddress()
           
NewsAddress(String newsgroup)
           
NewsAddress(String newsgroup, String host)
           
 
Method Summary
 boolean equals(Object o)
          Subclasses must provide a suitable implementation of equals().
 String getHost()
           
 String getNewsgroup()
           
 String getType()
          The type of this address; always "news".
 int hashCode()
           
static NewsAddress[] parse(String addresses)
          Parse a comma-spearated list of addresses.
 void setHost(String host)
           
 void setNewsgroup(String newsgroup)
           
 String toString()
          Subclasses must provide a suitable representation of their address.
static String toString(Address[] addresses)
          Convert the supplied addresses to a comma-separated String.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

host

protected String host
The host for this newsgroup


newsgroup

protected String newsgroup
The name of this newsgroup

Constructor Detail

NewsAddress

public NewsAddress()

NewsAddress

public NewsAddress(String newsgroup)

NewsAddress

public NewsAddress(String newsgroup,
                   String host)
Method Detail

getType

public String getType()
The type of this address; always "news".

Specified by:
getType in class Address
Returns:
"news"

setNewsgroup

public void setNewsgroup(String newsgroup)

getNewsgroup

public String getNewsgroup()

setHost

public void setHost(String host)

getHost

public String getHost()

toString

public String toString()
Description copied from class: Address
Subclasses must provide a suitable representation of their address.

Specified by:
toString in class Address
Returns:
a representation of an Address as a String

equals

public boolean equals(Object o)
Description copied from class: Address
Subclasses must provide a suitable implementation of equals().

Specified by:
equals in class Address
Parameters:
o - the object to compare t
Returns:
true if the subclass determines the other object is equal to this Address

hashCode

public int hashCode()
Overrides:
hashCode in class Object

parse

public static NewsAddress[] parse(String addresses)
                           throws AddressException
Parse a comma-spearated list of addresses.

Parameters:
addresses - the list to parse
Returns:
the array of extracted addresses
Throws:
AddressException - if one of the addresses is invalid

toString

public static String toString(Address[] addresses)
Convert the supplied addresses to a comma-separated String. If addresses is null, returns null; if empty, returns an empty string.

Parameters:
addresses - the addresses to convert
Returns:
a comma-separated list of addresses


Copyright © 2003-2008 The Apache Software Foundation. All Rights Reserved.