public enum InternetProtocolFamily extends java.lang.Enum<InternetProtocolFamily>
DatagramChannel
限定符和类型 | 方法和说明 |
---|---|
int |
addressNumber()
Returns the
address number
of the family.
|
java.lang.Class<? extends java.net.InetAddress> |
addressType()
Returns the address type of this protocol family.
|
java.net.InetAddress |
localhost()
Returns the
InetAddress that represent the LOCALHOST for the family. |
static InternetProtocolFamily |
of(java.net.InetAddress address)
Returns the
InternetProtocolFamily for the given InetAddress . |
static InternetProtocolFamily |
valueOf(java.lang.String name)
返回带有指定名称的该类型的枚举常量。
|
static InternetProtocolFamily[] |
values()
按照声明该枚举类型的常量的顺序, 返回
包含这些常量的数组。
|
public static final InternetProtocolFamily IPv4
public static final InternetProtocolFamily IPv6
public static InternetProtocolFamily[] values()
for (InternetProtocolFamily c : InternetProtocolFamily.values()) System.out.println(c);
public static InternetProtocolFamily valueOf(java.lang.String name)
name
- 要返回的枚举常量的名称。java.lang.IllegalArgumentException
- 如果该枚举类型没有带有指定名称的常量java.lang.NullPointerException
- 如果参数为空值public java.lang.Class<? extends java.net.InetAddress> addressType()
public int addressNumber()
public java.net.InetAddress localhost()
InetAddress
that represent the LOCALHOST
for the family.public static InternetProtocolFamily of(java.net.InetAddress address)
InternetProtocolFamily
for the given InetAddress
.