public class NewsAddress extends Address
Modifier and Type | Field and Description |
---|---|
protected String |
host |
protected String |
newsgroup |
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public NewsAddress()
public NewsAddress(String newsgroup)
newsgroup
- the newsgrouppublic String getType()
getType
in class Address
InternetAddress
public void setNewsgroup(String newsgroup)
newsgroup
- the newsgrouppublic String getNewsgroup()
public void setHost(String host)
host
- the hostpublic String getHost()
public String toString()
public boolean equals(Object a)
public int hashCode()
public static String toString(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 static NewsAddress[] parse(String newsgroups) throws AddressException
newsgroups
- comma separated newsgroup stringAddressException
- if the parse failedCopyright © 1996-2018, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.