public class InterfaceAddress extends Object
NetworkInterface
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
将此对象与指定的对象进行比较。
|
InetAddress |
getAddress()
返回该地址的
InetAddress 。
|
InetAddress |
getBroadcast()
返回此interfaceaddress广播地址的
InetAddress 。
|
short |
getNetworkPrefixLength()
返回此地址的网络前缀长度。
|
int |
hashCode()
返回该接口地址的hash码。
|
String |
toString()
将这一
String 接口地址。
|
public InetAddress getAddress()
InetAddress
。
InetAddress
。
public InetAddress getBroadcast()
InetAddress
。
因此只有IPv4网络的广播地址,在IPv6网络的情况下,null
将返回。
null
的
InetAddress
如果没有广播地址。
public short getNetworkPrefixLength()
典型的IPv6的值将是128(::1 / 128)或10(fe80::203::fe27:1243 BAFF / 10)
short
表示该地址的子网前缀长度。
public boolean equals(Object obj)
true
如果只有参数不
null
它代表相同的接口地址为该对象。
对InterfaceAddress
两实例表示相同的地址如果InetAddress,前缀长度和广播都是一样的。
equals
方法重写,继承类
Object
obj
-比较的对象。
true
如果对象是相同的;
false
否则。
hashCode()
public int hashCode()
hashCode
方法重写,继承类
Object
Object.equals(java.lang.Object)
,
System.identityHashCode(java.lang.Object)
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.