|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
javax.mail.internet Class NewsAddress
java.lang.Object javax.mail.Address 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 |
host
|
protected String |
newsgroup
|
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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 newsgroup 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. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
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 newsgrouphost
- 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".
- 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.
- Returns:
- newsgroup
public boolean
equals(Object a)
相等性运算符。
英文文档:
equals
public boolean equals(Object a)
public int
hashCode()
计算地址的哈希码。
英文文档:
hashCode
public int hashCode()
public static String
toString(Address[] addresses)
将给定的 NewsAddress 对象数组转换为以逗号分隔的地址字符串序列。所得字符串仅包含 US-ASCII 字符,因此对于邮件是安全的。
addresses | NewsAddress 对象数组 |
Throws | ClassCastException,: 如果给定数组中的任何地址对象不是 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 对象数组 |
Throws | AddressException: 如果解析失败 |
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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Submit a bug or feature
Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!