javax.mail.internet
Class NewsAddress
- Serializable
This class models an RFC1036 newsgroup address.
protected String | host - The host name of the news server.
|
protected String | newsgroup - The name of the newsgroup.
|
NewsAddress() - Default constructor.
|
NewsAddress(String newsgroup) - Construct a NewsAddress with the given newsgroup.
|
NewsAddress(String newsgroup, String host) - Construct a NewsAddress with the given newsgroup and host.
|
boolean | equals(Object a) - The equality operator.
|
String | getHost() - Get the host.
|
String | getNewsgroup() - Get the newsgroup.
|
String | getType() - Return the type of this address.
|
int | hashCode() - Compute a hash code for the address.
|
static NewsAddress[] | parse(String newsgroups) - Parse the given comma separated sequence of newsgroups into NewsAddress
objects.
|
void | setHost(String host) - Set the host.
|
void | setNewsgroup(String newsgroup) - Set the newsgroup.
|
String | toString() - Convert this address into a RFC 1036 address.
|
static String | toString(Address[] addresses) - Convert the given array of NewsAddress objects into a comma separated
sequence of address strings.
|
host
protected String host
The host name of the news server.
newsgroup
protected String newsgroup
The name of the newsgroup.
NewsAddress
public NewsAddress()
Default constructor.
NewsAddress
public NewsAddress(String newsgroup)
Construct a NewsAddress with the given newsgroup.
newsgroup
- the newsgroup
NewsAddress
public NewsAddress(String newsgroup,
String host)
Construct a NewsAddress with the given newsgroup and host.
newsgroup
- the newsgrouphost
- the host
equals
public boolean equals(Object a)
The equality operator.
- equals in interface Address
getHost
public String getHost()
Get the host.
getNewsgroup
public String getNewsgroup()
Get the newsgroup.
getType
public String getType()
Return the type of this address.
The type of a NewsAddress is "news".
- getType in interface Address
hashCode
public int hashCode()
Compute a hash code for the address.
parse
public static NewsAddress[] parse(String newsgroups)
throws AddressException
Parse the given comma separated sequence of newsgroups into NewsAddress
objects.
newsgroups
- comma separated newsgroup string
- array of NewsAddress objects
AddressException
- if the parse failed
setHost
public void setHost(String host)
Set the host.
host
- the host
setNewsgroup
public void setNewsgroup(String newsgroup)
Set the newsgroup.
newsgroup
- the newsgroup
toString
public String toString()
Convert this address into a RFC 1036 address.
- toString in interface Address
toString
public static String toString(Address[] addresses)
Convert the given array of NewsAddress objects into a comma separated
sequence of address strings.
The resulting string contains only US-ASCII characters, and hence
is mail-safe.
addresses
- array of NewsAddress objects
- comma separated address strings