javax.mail.internet
public class NewsAddress extends Address
Modifier and Type | Field and Description |
---|---|
protected String |
host
The hostname of the news server.
|
protected String |
newsgroup
The name of the newsgroup.
|
Constructor and Description |
---|
NewsAddress()
Constructor for an empty news address.
|
NewsAddress(String newsgroup)
Constructor with the given newsgroup.
|
NewsAddress(String newsgroup,
String host)
Constructor with the given newsgroup and host.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object a) |
String |
getHost()
Returns the hostname of the news server.
|
String |
getNewsgroup()
Returns the newsgroup.
|
String |
getType()
Returns the type of this address.
|
int |
hashCode() |
static NewsAddress[] |
parse(String newsgroups)
Parses the given comma-separated sequence of newsgroups into
NewsAddresses.
|
void |
setHost(String host)
Sets the hostname of the news server.
|
void |
setNewsgroup(String newsgroup)
Sets the newsgroup.
|
String |
toString()
Returns an RFC 1036 string representation of this address.
|
static String |
toString(Address[] addresses)
Converts the given array of NewsAddresses into a comma-separated
sequence of address strings.
|
protected String newsgroup
protected String host
public NewsAddress()
public NewsAddress(String newsgroup)
newsgroup
- the newsgrouppublic String getType()
NewsAddress
is "news".public void setNewsgroup(String newsgroup)
newsgroup
- the newsgrouppublic String getNewsgroup()
public void setHost(String host)
host
- the host namepublic String getHost()
public String toString()
public static String toString(Address[] addresses)
addresses
- the NewsAddress objectsClassCastException
- if any of the specified addresses
is not a NewsAddresspublic static NewsAddress[] parse(String newsgroups) throws AddressException
newsgroups
- a comma-separated newsgroup stringAddressException
- if the parse failed© Copyright 2003, 2004 The Free Software Foundation, All rights reserved