NewsAddress (Java EE 5)

Java EE API


javax.mail.internet Class NewsAddress

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

public class NewsAddress
extends Address

Extends: Address

此类模拟 RFC1036 新闻组地址。
英文文档:

This class models an RFC1036 newsgroup address.

Author:
Bill Shannon, John Mani
See Also:
Serialized Form

Field Summary
protected  String
protected  String
 
Constructor Summary
 
Method Summary
 boolean
 String
 String
 String
 int
static NewsAddress[]
 void
 void
 String
static String
 
Methods inherited from class java.lang.Object
 

Field Detail

英文文档:

newsgroup

protected String newsgroup

英文文档:

host

protected String host
Constructor Detail

public NewsAddress()
默认构造方法。
英文文档:

NewsAddress

public NewsAddress()
Default constructor.


public NewsAddress(String newsgroup)
构造带给定新闻组的 NewsAddress。
newsgroup 新闻组
英文文档:

NewsAddress

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

Parameters:
newsgroup - the newsgroup


public NewsAddress(String newsgroup, String host)
构造带给定新闻组和主机的 NewsAddress。
newsgroup 新闻组
host 主机
英文文档:

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

public String getType()
返回此地址的类型。NewsAddress 的类型为 "news"。
英文文档:

getType

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

Specified by:
getType in class Address
Returns:
address type
See Also:
InternetAddress

public void setNewsgroup(String newsgroup)
设置新闻组。
newsgroup 新闻组
英文文档:

setNewsgroup

public void setNewsgroup(String newsgroup)
Set the newsgroup.

Parameters:
newsgroup - the newsgroup

public String getNewsgroup()
获取新闻组。
return 新闻组
英文文档:

getNewsgroup

public String getNewsgroup()
Get the newsgroup.

Returns:
newsgroup

public void setHost(String host)
设置主机。
host 主机
英文文档:

setHost

public void setHost(String host)
Set the host.

Parameters:
host - the host

public String getHost()
获取主机。
return 主机
英文文档:

getHost

public String getHost()
Get the host.

Returns:
host

public String toString()
将此地址转换为 RFC 1036 地址。
return 新闻组
英文文档:

toString

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

Specified by:
toString in class Address
Returns:
newsgroup

public boolean equals(Object a)
相等性运算符。
英文文档:

equals

public boolean equals(Object a)
The equality operator.

Specified by:
equals in class Address
Parameters:
a - Address object

public int hashCode()
计算地址的哈希码。
英文文档:

hashCode

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

Overrides:
hashCode in class Object

public static String toString(Address[] addresses)
将给定的 NewsAddress 对象数组转换为以逗号分隔的地址字符串序列。所得字符串仅包含 US-ASCII 字符,因此对于邮件是安全的。
addresses NewsAddress 对象数组
ThrowsClassCastException,: 如果给定数组中的任何地址对象不是 NewsAddress 对象。注意,这是一个 RuntimeException。
return 以逗号分隔的地址字符串
英文文档:

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
Throws:
ClassCastException, - 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
将给定的以逗号分隔的新闻组序列解析为 NewsAddress 对象。
newsgroups 以逗号分隔的新闻组字符串
return NewsAddress 对象数组
ThrowsAddressException: 如果解析失败
英文文档:

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


Submit a bug or feature

Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

一看就知道只有菜鸟才干这么无知的事啦。

PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!