This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


javax.mail.internet
class NewsAddress

javax.mail.Address extended by javax.mail.internet.NewsAddress
All Implemented Interfaces:
Serializable

public class NewsAddress
extends Address

This class models an RFC1036 newsgroup address.

See Also (auto-generated):

Session

Properties

InternetAddress


Field Summary
protected String host
          
protected String newsgroup
          
 
Constructor Summary

          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.
 
Method Summary
 boolean

          The equality operator.
 String

          Get the host.
 String

          Get the newsgroup.
 String

          Return the type of this address.
 int

          Compute a hash code for the address.
static NewsAddress[]
parse(String newsgroups)

          Parse the given comma separated sequence of newsgroup into NewsAddress objects.
 void

          Set the host.
 void
setNewsgroup(String newsgroup)

          Set the newsgroup.
 String

          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.
 
Methods inherited from class javax.mail.Address
equals, getType, toString
 

Field Detail

host

protected String host

newsgroup

protected String newsgroup
Constructor Detail

NewsAddress

public NewsAddress()
Default constructor.


NewsAddress

public NewsAddress(String newsgroup)
Construct a NewsAddress with the given newsgroup.

Parameters:
newsgroup - the newsgroup

NewsAddress

public NewsAddress(String newsgroup,
                   String host)
Construct a NewsAddress with the given newsgroup and host.

Parameters:
newsgroup - the newsgroup
host - the host
Method Detail

equals

public boolean equals(Object a)
The equality operator.

Overrides:
equals in class Address
Parameters:
a

getHost

public String getHost()
Get the host.

Returns:
host

getNewsgroup

public String getNewsgroup()
Get the newsgroup.

Returns:
newsgroup

getType

public String getType()
Return the type of this address. The type of a NewsAddress is "news".

Overrides:
getType in class Address

hashCode

public int hashCode()
Compute a hash code for the address.

Overrides:
hashCode in class Object

parse

public static NewsAddress[] parse(String newsgroups)
                           throws AddressException
Parse the given comma separated sequence of newsgroup into NewsAddress objects.

Parameters:
newsgroups - comma separated newsgroup string
Returns:
array of NewsAddress objects
Throws:
AddressException - if the parse failed

setHost

public void setHost(String host)
Set the host.

Parameters:
host - the host

setNewsgroup

public void setNewsgroup(String newsgroup)
Set the newsgroup.

Parameters:
newsgroup - the newsgroup

toString

public String toString()
Convert this address into a RFC 1036 address.

Overrides:
toString in class Address
Returns:
newsgroup

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.

Parameters:
addresses - array of NewsAddress objects
Returns:
comma separated address strings


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention. The official Sun™ documentation can be found here at http://java.sun.com/products/javamail/javadocs/index.html.