Class Overview
Identifies an IP address on a network link.
A LinkAddress
consists of:
- An IP address and prefix length (e.g.,
2001:db8::1/64
or 192.0.2.1/24
).
The address must be unicast, as multicast addresses cannot be assigned to interfaces.
- Address flags: A bitmask of
OsConstants.IFA_F_*
values representing properties
of the address (e.g., android.system.OsConstants.IFA_F_OPTIMISTIC
).
- Address scope: One of the
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
).
Summary
Public Methods |
boolean
|
equals(Object obj)
Compares this LinkAddress instance against obj .
|
InetAddress
|
getAddress()
|
int
|
getFlags()
Returns the flags of this LinkAddress .
|
int
|
getPrefixLength()
Returns the prefix length of this LinkAddress .
|
int
|
getScope()
Returns the scope of this LinkAddress .
|
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".
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this Object .
|
boolean
|
equals(Object o)
Compares this instance with the specified object and indicates if they
are equal.
|
void
|
finalize()
Invoked when the garbage collector has detected that this instance is no longer reachable.
|
final
Class<?>
|
getClass()
Returns the unique instance of Class that represents this
object's class.
|
int
|
hashCode()
Returns an integer hash code for this object.
|
final
void
|
notify()
Causes a thread which is waiting on this object's monitor (by means of
calling one of the wait() methods) to be woken up.
|
final
void
|
notifyAll()
Causes all threads which are waiting on this object's monitor (by means
of calling one of the wait() methods) to be woken up.
|
String
|
toString()
Returns a string containing a concise, human-readable description of this
object.
|
final
void
|
wait()
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.
|
final
void
|
wait(long millis, int nanos)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait(long millis)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
|
From interface
android.os.Parcelable
abstract
int
|
describeContents()
Describe the kinds of special objects contained in this Parcelable's
marshalled representation.
|
abstract
void
|
writeToParcel(Parcel dest, int flags)
Flatten this object in to a Parcel.
|
|
Public Methods
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
| the object to be tested for equality. |
Returns
true
if both objects are equal, false
otherwise.
public
int
getFlags
()
Returns the flags of this LinkAddress
.
public
int
getPrefixLength
()
Returns the prefix length of this LinkAddress
.
public
int
getScope
()
Returns the scope of this LinkAddress
.
public
int
hashCode
()
Returns a hashcode for this address.
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
- a printable representation of this object.