public class LinkAddress
extends Object implements Parcelable
| java.lang.Object | |
| android.net.LinkAddress | |
标识网络链接上的IP地址。 A LinkAddress包括:
2001:db8::1/64 or 192.0.2.1/24). The address must be unicast, as multicast addresses cannot be assigned to interfaces. OsConstants.IFA_F_* values representing properties of the address (e.g., android.system.OsConstants.IFA_F_OPTIMISTIC). OsConstants.IFA_F_* values; defines the scope in which the address is unique (e.g., android.system.OsConstants.RT_SCOPE_LINK or android.system.OsConstants.RT_SCOPE_UNIVERSE). Inherited constants |
|---|
android.os.Parcelable
|
Fields |
|
|---|---|
public static final Creator<LinkAddress> |
CREATOR 实现Parcelable接口。 |
公共方法(Public methods) |
|
|---|---|
int |
describeContents() 实现Parcelable接口。 |
boolean |
equals(Object obj) 将此 |
InetAddress |
getAddress() 返回 |
int |
getFlags() 返回这个 |
int |
getPrefixLength() 返回此 |
int |
getScope() 返回这个 |
int |
hashCode() 返回此地址的哈希码。 |
String |
toString() 返回此地址的字符串表示形式,如“192.0.2.1/24”或“2001:db8 :: 1/64”。 |
void |
writeToParcel(Parcel dest, int flags) 实现Parcelable接口。 |
继承方法(Inherited methods) |
|
|---|---|
java.lang.Object
|
|
android.os.Parcelable
|
|
int describeContents ()
实现Parcelable接口。
| 返回(Returns) | |
|---|---|
int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. |
boolean equals (Object obj)
将此LinkAddress实例与obj比较。 如果地址,前缀长度,标志和范围相等,则两个地址相等。 因此,例如,如果其中一个地址和前缀长度不一致,而另一个地址和前缀长度不相等,则两个地址不相等。
| 参数(Parameters) | |
|---|---|
obj |
Object: the object to be tested for equality. |
| 返回(Returns) | |
|---|---|
boolean |
true if both objects are equal, false otherwise. |
InetAddress getAddress ()
返回 InetAddress的 LinkAddress 。
| 返回(Returns) | |
|---|---|
InetAddress |
|
int hashCode ()
返回此地址的哈希码。
| 返回(Returns) | |
|---|---|
int |
a hash code value for this object. |
String toString ()
返回此地址的字符串表示形式,如“192.0.2.1/24”或“2001:db8 :: 1/64”。 字符串表示不包含标志和范围,只是地址和前缀长度。
| 返回(Returns) | |
|---|---|
String |
a string representation of the object. |
void writeToParcel (Parcel dest, int flags)
实现Parcelable接口。
| 参数(Parameters) | |
|---|---|
dest |
Parcel: The Parcel in which the object should be written. |
flags |
int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. |