# Print output for @column tags ?>
public
class
LinkAddress
extends Object
implements
Parcelable
java.lang.Object | |
↳ | android.net.LinkAddress |
Identifies an IP address on a network link.
A LinkAddress
consists of:
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 |
---|
Fields | |
---|---|
public
static
final
Creator<LinkAddress> |
CREATOR
Implement the Parcelable interface. |
Public methods | |
---|---|
int
|
describeContents()
Implement the Parcelable interface. |
boolean
|
equals(Object obj)
Compares this |
InetAddress
|
getAddress()
Returns the |
int
|
getFlags()
Returns the flags of this |
int
|
getPrefixLength()
Returns the prefix length of this |
int
|
getScope()
Returns the scope of this |
int
|
hashCode()
Returns a hashcode for this address. |
String
|
toString()
Returns a string representation of this address, such as "192.0.2.1/24" or "2001:db8::1/64". |
void
|
writeToParcel(Parcel dest, int flags)
Implement the Parcelable interface. |
Inherited methods | |
---|---|
public int describeContents ()
Implement the Parcelable interface.
Returns | |
---|---|
int |
a bitmask indicating the set of special object types marshaled
by this Parcelable object instance.
Value is either 0 or CONTENTS_FILE_DESCRIPTOR |
public boolean equals (Object obj)
Compares this LinkAddress
instance against obj
. Two addresses are equal if
their address, prefix length, flags and scope are equal. Thus, for example, two addresses
that have the same address and prefix length are not equal if one of them is deprecated and
the other is not.
Parameters | |
---|---|
obj |
Object : the object to be tested for equality. |
Returns | |
---|---|
boolean |
true if both objects are equal, false otherwise. |
public InetAddress getAddress ()
Returns the InetAddress
of this LinkAddress
.
Returns | |
---|---|
InetAddress |
public int getFlags ()
Returns the flags of this LinkAddress
.
Returns | |
---|---|
int |
public int getPrefixLength ()
Returns the prefix length of this LinkAddress
.
Returns | |
---|---|
int |
Value is between 0 and 128 inclusive |
public int getScope ()
Returns the scope of this LinkAddress
.
Returns | |
---|---|
int |
public int hashCode ()
Returns a hashcode for this address.
Returns | |
---|---|
int |
a hash code value for this object. |
public String toString ()
Returns a string representation of this address, such as "192.0.2.1/24" or "2001:db8::1/64". The string representation does not contain the flags and scope, just the address and prefix length.
Returns | |
---|---|
String |
a string representation of the object. |
public void writeToParcel (Parcel dest, int flags)
Implement the Parcelable interface.
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.PARCELABLE_WRITE_RETURN_VALUE .
Value is either 0 or a combination of Parcelable.PARCELABLE_WRITE_RETURN_VALUE , and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |