javax.mail.internet

Class NewsAddress

Implemented Interfaces:
Serializable

public class NewsAddress
extends Address

A representation of an RFC1036 Internet newsgroup address.

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 javax.mail.Address

equals, getType, toString

Field Details

host

protected String host
The host for this newsgroup

newsgroup

protected String newsgroup
The name of this newsgroup

Constructor Details

NewsAddress

public NewsAddress()

NewsAddress

public NewsAddress(String newsgroup)

NewsAddress

public NewsAddress(String newsgroup,
                   String host)

Method Details

equals

public boolean equals(Object o)
Subclasses must provide a suitable implementation of equals().
Overrides:
equals in interface Address
Parameters:
Returns:
true if the subclass determines the other object is equal to this Address

getHost

public String getHost()

getNewsgroup

public String getNewsgroup()

getType

public String getType()
The type of this address; always "news".
Overrides:
getType in interface Address
Returns:
"news"

hashCode

public int hashCode()

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

setHost

public void setHost(String host)

setNewsgroup

public void setNewsgroup(String newsgroup)

toString

public String toString()
Subclasses must provide a suitable representation of their address.
Overrides:
toString in interface Address
Returns:
a representation of an Address as a String

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