|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.sun.multicast.allocation.IPv4Address
An IPv4 network address.
Objects of this class and all values returned by their methods are immutable. That is, their values cannot change after they are constructed.
| Constructor Summary | |
IPv4Address(java.net.InetAddress inetAddr)
Creates an AddressRange with the specified addresses. |
|
| Method Summary | |
int |
compareTo(java.lang.Object o)
Compares this Address with the specified
object for order. |
long |
difference(Address otherAddress)
Returns the difference between this Address
and another one. |
boolean |
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one. |
AddressType |
getAddressType()
Gets the AddressType of this Address. |
byte[] |
getBytes()
Gets a byte array representing this Address. |
int |
hashCode()
Returns a hash code value for this object. |
IPv4Address |
nextAddress()
Returns the next IPv4Address. |
IPv4Address |
previousAddress()
Returns the previous IPv4Address. |
java.net.InetAddress |
toInetAddress()
Returns an InetAddress value for the address. |
int |
toInt()
Returns an int value for the address. |
long |
toLong()
Returns a long value for the address. |
java.lang.String |
toString()
Returns a string representation of this IPv4Address. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public IPv4Address(java.net.InetAddress inetAddr)
AddressRange with the specified addresses.startAddress - the first address in the rangeendAddress - the last address in the range| Method Detail |
public int compareTo(java.lang.Object o)
throws java.lang.ClassCastException
Address with the specified
object for order. Returns a negative integer, zero, or
a positive integer as this object is less than, equal
to, or greater than the specified object.
If this address is less than the other one, an integer less
than zero is returned. If this address is greater than the
other one, an integer greater than zero is returned. If the
two addresses are equal, zero is returned. If the two addresses
cannot be compared (usually because they are of different
AddressTypes), a ClassCastException is thrown.
This method imposes a total ordering on addresses of the same
AddressType.
compareTo in interface Addresso - the Object to compare againstjava.lang.ClassCastException - if the objects cannot be comparedpublic boolean equals(java.lang.Object obj)
IPv4Addresses are equal if and only if they represent
the same address.equals in class java.lang.Objectobj - the object with which to comparetrue if this object is the same as the
reference object, false otherwise.public int hashCode()
IPv4Addresses are equal if and only if they
are equal.hashCode in class java.lang.ObjectIPv4Addresspublic int toInt()
IPv4Addresspublic long toLong()
IPv4Addresspublic java.net.InetAddress toInetAddress()
IPv4Addresspublic IPv4Address previousAddress()
IPv4Address.IPv4Addresspublic IPv4Address nextAddress()
IPv4Address.IPv4Addresspublic long difference(Address otherAddress)
Address
and another one. If this address is less than the other one, a
value greater than zero is returned. If this address is greater than
the other one, a value less than zero is returned. If the
two addresses are equal, zero is returned.otherAddress - the Address to do a difference withAddress and
the other onepublic byte[] getBytes()
Address.getBytes in interface AddressAddresspublic AddressType getAddressType()
AddressType of this Address.getAddressType in interface AddressAddressType of this Addresspublic java.lang.String toString()
IPv4Address.toString in class java.lang.ObjectIPv4Address
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
JavaTM Reliable MulticastTM Service version 1.1
Copyright (c) 2001, Sun Microsystems Laboratories, All rights reserved.