javax.mail.internet

Class NewsAddress

public class NewsAddress extends Address

A representation of an RFC1036 Internet newsgroup address.
Field Summary
protected Stringhost
The host for this newsgroup
protected Stringnewsgroup
The name of this newsgroup
Constructor Summary
NewsAddress()
NewsAddress(String newsgroup)
NewsAddress(String newsgroup, String host)
Method Summary
booleanequals(Object o)
StringgetHost()
StringgetNewsgroup()
StringgetType()
The type of this address; always "news".
inthashCode()
static NewsAddress[]parse(String addresses)
Parse a comma-spearated list of addresses.
voidsetHost(String host)
voidsetNewsgroup(String newsgroup)
StringtoString()
static StringtoString(Address[] addresses)
Convert the supplied addresses to a comma-separated String.

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

equals

public boolean equals(Object o)

getHost

public String getHost()

getNewsgroup

public String getNewsgroup()

getType

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

Returns: "news"

hashCode

public int hashCode()

parse

public static NewsAddress[] parse(String addresses)
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()

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