java.lang.Object | +--javax.mail.Address | +--javax.mail.internet.NewsAddress
This class models an RFC1036 newsgroup address.
host | |
newsgroup |
NewsAddress() Default constructor. | |
NewsAddress(java.lang.String newsgroup) Construct a NewsAddress with the given newsgroup. | |
NewsAddress(java.lang.String newsgroup, java.lang.String host) Construct a NewsAddress with the given newsgroup and host. |
equals(java.lang.Object a) The equality operator. | |
getHost() Get the host. | |
getNewsgroup() Get the newsgroup. | |
getType() Return the type of this address. | |
hashCode() Compute a hash code for the address. | |
parse(java.lang.String newsgroups) Parse the given comma separated sequence of newsgroup into NewsAddress objects. | |
setHost(java.lang.String host) Set the host. | |
setNewsgroup(java.lang.String newsgroup) Set the newsgroup. | |
toString() Convert this address into a RFC 1036 address. | |
toString(Address[] addresses) Convert the given array of NewsAddress objects into a comma separated sequence of address strings. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
protected java.lang.Stringnewsgroup
protected java.lang.Stringhost
publicNewsAddress()
publicNewsAddress(java.lang.String newsgroup)
newsgroup
- the newsgrouppublicNewsAddress(java.lang.String newsgroup, java.lang.String host)
newsgroup
- the newsgrouphost
- the hostpublic java.lang.StringgetType()
getType
in classAddress
javax.mail.Address
InternetAddress
public voidsetNewsgroup(java.lang.String newsgroup)
newsgroup
- the newsgrouppublic java.lang.StringgetNewsgroup()
public voidsetHost(java.lang.String host)
host
- the hostpublic java.lang.StringgetHost()
public java.lang.StringtoString()
toString
in classAddress
public booleanequals(java.lang.Object a)
equals
in classAddress
javax.mail.Address
address
- Address objectpublic inthashCode()
hashCode
in classjava.lang.Object
public static java.lang.StringtoString(Address[] addresses)
addresses
- array of NewsAddress objectsClassCastException,
- if any address object in the given array is not a NewsAddress objects. Note that this is a RuntimeException.public staticNewsAddress[]parse(java.lang.String newsgroups) throwsAddressException
newsgroups
- comma separated newsgroup stringAddressException
- if the parse failed