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