public class IPAddress extends Object implements Comparable<IPAddress>
Modifier and Type | Field and Description |
---|---|
protected InetAddress |
m_inetAddress |
Constructor and Description |
---|
IPAddress(byte[] ipAddrOctets) |
IPAddress(InetAddress inetAddress) |
IPAddress(IPAddress addr) |
IPAddress(String dottedNotation) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(IPAddress o) |
IPAddress |
decr()
decr
|
boolean |
equals(Object obj) |
static int |
fromBytes(byte b1,
byte b2,
byte b3,
byte b4)
Returns the
int value whose byte representation is the given 4
bytes, in big-endian order; equivalent to Ints.fromByteArray(new
byte[] {b1, b2, b3, b4}) . |
int |
hashCode() |
IPAddress |
incr()
incr
|
boolean |
isGreaterThan(IPAddress other)
isGreaterThan
|
boolean |
isGreaterThanOrEqualTo(IPAddress other)
isGreaterThanOrEqualTo
|
boolean |
isLessThan(IPAddress other)
isLessThan
|
boolean |
isLessThanOrEqualTo(IPAddress other)
isLessThanOrEqualTo
|
boolean |
isPredecessorOf(IPAddress other)
isPredecessorOf
|
boolean |
isSuccessorOf(IPAddress other)
isSuccessorOf
|
static IPAddress |
max(IPAddress a,
IPAddress b)
max
|
static IPAddress |
min(IPAddress a,
IPAddress b) |
BigInteger |
toBigInteger() |
String |
toDbString() |
InetAddress |
toInetAddress() |
protected byte[] |
toIpAddrBytes(String dottedNotation) |
protected String |
toIpAddrString(byte[] addr) |
protected String |
toIpAddrString(InetAddress addr) |
byte[] |
toOctets() |
String |
toString() |
String |
toUserString() |
protected final InetAddress m_inetAddress
public IPAddress(IPAddress addr)
public IPAddress(String dottedNotation)
public IPAddress(InetAddress inetAddress)
public IPAddress(byte[] ipAddrOctets)
public InetAddress toInetAddress()
public byte[] toOctets()
public int compareTo(IPAddress o)
compareTo
in interface Comparable<IPAddress>
public String toUserString()
public String toDbString()
public BigInteger toBigInteger()
public boolean isPredecessorOf(IPAddress other)
isPredecessorOf
other
- a IPAddress
object.public boolean isSuccessorOf(IPAddress other)
isSuccessorOf
other
- a IPAddress
object.public boolean isLessThan(IPAddress other)
isLessThan
other
- a IPAddress
object.public boolean isLessThanOrEqualTo(IPAddress other)
isLessThanOrEqualTo
other
- a IPAddress
object.public boolean isGreaterThan(IPAddress other)
isGreaterThan
other
- a IPAddress
object.public boolean isGreaterThanOrEqualTo(IPAddress other)
isGreaterThanOrEqualTo
other
- a IPAddress
object.protected String toIpAddrString(InetAddress addr)
protected String toIpAddrString(byte[] addr)
protected byte[] toIpAddrBytes(String dottedNotation)
public static int fromBytes(byte b1, byte b2, byte b3, byte b4)
int
value whose byte representation is the given 4
bytes, in big-endian order; equivalent to Ints.fromByteArray(new
byte[] {b1, b2, b3, b4})
.
From: Guava.
Copyright © 2020. All rights reserved.