public final class IPv6Address extends Object implements Comparable<IPv6Address>
| Modifier and Type | Method and Description |
|---|---|
IPv6Address |
add(int value)
Addition.
|
int |
compareTo(IPv6Address that) |
boolean |
equals(Object o) |
static IPv6Address |
fromByteArray(byte[] bytes)
Create an IPv6 address from a byte array.
|
static IPv6Address |
fromInetAddress(InetAddress inetAddress)
Create an IPv6 address from a java.net.Inet6Address.
|
static IPv6Address |
fromLongs(long highBits,
long lowBits)
Construct an IPv6Address from two longs representing the 64 highest and 64 lowest bits.
|
static IPv6Address |
fromString(String string)
Create an IPv6 address from its String representation.
|
long |
getHighBits() |
long |
getLowBits() |
int |
hashCode() |
IPv6Address |
maskWithNetworkMask(IPv6NetworkMask networkMask)
Mask the address with the given network mask.
|
IPv6Address |
maximumAddressWithNetworkMask(IPv6NetworkMask networkMask)
Calculate the maximum address with the given network mask.
|
int |
numberOfLeadingOnes() |
int |
numberOfLeadingZeroes() |
int |
numberOfTrailingOnes() |
int |
numberOfTrailingZeroes() |
IPv6Address |
subtract(int value)
Subtraction.
|
byte[] |
toByteArray() |
InetAddress |
toInetAddress() |
String |
toLongString() |
String |
toString() |
public static IPv6Address fromLongs(long highBits, long lowBits)
String or an InetAddress. The internal representation of an IPv6Address is exactly
these two longs though, so if you already happen to have them, this provides a very efficient way to construct an IPv6Address.highBits - highest order bitslowBits - lowest order bitspublic static IPv6Address fromString(String string)
string - string representationpublic static IPv6Address fromInetAddress(InetAddress inetAddress)
inetAddress - Inet6Address representationpublic InetAddress toInetAddress() throws UnknownHostException
UnknownHostExceptionpublic static IPv6Address fromByteArray(byte[] bytes)
bytes - byte array with 16 bytespublic byte[] toByteArray()
public IPv6Address add(int value)
value - value to addpublic IPv6Address subtract(int value)
value - value to substractpublic IPv6Address maskWithNetworkMask(IPv6NetworkMask networkMask)
networkMask - network maskpublic IPv6Address maximumAddressWithNetworkMask(IPv6NetworkMask networkMask)
networkMask - network maskpublic String toString()
public String toLongString()
public int compareTo(IPv6Address that)
compareTo in interface Comparable<IPv6Address>public long getHighBits()
public long getLowBits()
public int numberOfTrailingZeroes()
public int numberOfTrailingOnes()
public int numberOfLeadingZeroes()
public int numberOfLeadingOnes()
Copyright © 2013. All Rights Reserved.