| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| private Inet4Address | broadcast
The cached broadcast address. |
| private final byte[] | cachedBytes
The cached bytes of this address. |
| private int | hashCode
The cached hash code of this object. |
| public static final CidrAddress | INET4_ANY_CIDR
The CIDR address representing all IPv4 addresses. |
| public static final CidrAddress | INET6_ANY_CIDR
The CIDR address representing all IPv6 addresses. |
| private final int | netmaskBits
The number of netmask bits. |
| private final InetAddress | networkAddress
The base network address of this CIDR address. |
| private static final long | |
| private String | toString
The cached to-string value of this object. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static boolean | |
| public int | Returns: -1, 0, or 1 if this address is less than, equal to, or greater than the given addressthe bytes to compare to (must not be otherBytes, final int null)the netmask bits for the byte array otherNetmaskBits, final int the IPv6 scope ID, if any, or else zero scopeId)Compare the bytes of this address to the bytes in the given array. |
| public int | compareTo(final CidrAddress
the object to be compared. other)Implements java. Compares this object with the specified object for order. |
| public static CidrAddress | Returns: the CIDR address (notnull)the network address (must not be networkAddress, int null)the netmask bits (0-32 for IPv4, or 0-128 for IPv6) netmaskBits)Create a new CIDR address. |
| public static CidrAddress | Returns: the CIDR address (notnull)the network address bytes (must not be addressBytes, int null, must be 4 bytes for IPv4 or 16 bytes for
IPv6)the netmask bits (0-32 for IPv4, or 0-128 for IPv6) netmaskBits)Create a new CIDR address. |
| pack-priv static CidrAddress | |
| public boolean | Returns: true if this address is equal to the given object, or false if it is notthe other address obj)Overrides java. Returns |
| public boolean | Returns: true if this address is equal to the given address, or false if it is notthe other address obj)Returns |
| public Inet4Address | Returns: the broadcast address for this CIDR block, ornull if there is noneGet the broadcast address for this CIDR block. |
| public int | |
| public InetAddress | |
| public int | Returns: the scope ID, or 0 if there is none or the address is an IPv4 addressGet the match address scope ID (if it is an IPv6 address). |
| public int | |
| private static byte[] | |
| private static byte[] | |
| public boolean | Returns: true if the address matches, false otherwisethe address to test address)Determine if this CIDR address matches the given address. |
| public boolean | Returns: true if the address bytes match, false otherwisethe address bytes to test bytes)Determine if this CIDR address matches the given address bytes. |
| public boolean | Returns: true if the address bytes match, false otherwisethe address bytes to test bytes, int the scope ID, or 0 to match no scope scopeId)Determine if this CIDR address matches the given address bytes. |
| public boolean | Returns: true if the address matches, false otherwisethe address to test address)Determine if this CIDR address matches the given address. |
| public boolean | Returns: true if the address matches, false otherwisethe address to test address)Determine if this CIDR address matches the given address. |
| public boolean | Returns: true if the given block is enclosed by this one, false otherwisethe address to test address)Determine if this CIDR address matches the given CIDR address. |
| public String | |
| pack-priv Object | Returns: the serialization replacement for this objectReturns the serialization replacement for this object. |
| broadcast | back to summary |
|---|---|
| private Inet4Address broadcast The cached broadcast address. | |
| cachedBytes | back to summary |
|---|---|
| private final byte[] cachedBytes The cached bytes of this address. | |
| hashCode | back to summary |
|---|---|
| private int hashCode The cached hash code of this object. | |
| INET4_ANY_CIDR | back to summary |
|---|---|
| public static final CidrAddress INET4_ANY_CIDR The CIDR address representing all IPv4 addresses. | |
| INET6_ANY_CIDR | back to summary |
|---|---|
| public static final CidrAddress INET6_ANY_CIDR The CIDR address representing all IPv6 addresses. | |
| netmaskBits | back to summary |
|---|---|
| private final int netmaskBits The number of netmask bits. | |
| networkAddress | back to summary |
|---|---|
| private final InetAddress networkAddress The base network address of this CIDR address. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| toString | back to summary |
|---|---|
| private String toString The cached to-string value of this object. | |
| CidrAddress | back to summary |
|---|---|
| private CidrAddress(final InetAddress networkAddress, final int netmaskBits) | |
| bitsMatch | back to summary |
|---|---|
| private static boolean bitsMatch(byte[] address, byte[] test, int bits) | |
| compareAddressBytesTo | back to summary |
|---|---|
| public int compareAddressBytesTo(final byte[] otherBytes, final int otherNetmaskBits, final int scopeId) Compare the bytes of this address to the bytes in the given array.
| |
| compareTo | back to summary |
|---|---|
| public int compareTo(final CidrAddress other) Implements java. Doc from java. Compares this object 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. The implementor must ensure The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that
| |
| create | back to summary |
|---|---|
| public static CidrAddress create(InetAddress networkAddress, int netmaskBits) Create a new CIDR address.
| |
| create | back to summary |
|---|---|
| public static CidrAddress create(byte[] addressBytes, int netmaskBits) Create a new CIDR address.
| |
| create | back to summary |
|---|---|
| pack-priv static CidrAddress create(byte[] addressBytes, int netmaskBits, boolean clone) | |
| equals | back to summary |
|---|---|
| public boolean equals(final Object obj) Overrides java. Returns
| |
| equals | back to summary |
|---|---|
| public boolean equals(final CidrAddress obj) Returns
| |
| getBroadcastAddress | back to summary |
|---|---|
| public Inet4Address getBroadcastAddress() Get the broadcast address for this CIDR block. If the block has no broadcast address (either because it is IPv6
or it is too small) then
| |
| getNetmaskBits | back to summary |
|---|---|
| public int getNetmaskBits() Get the netmask bits. This will be in the range 0-32 for IPv4 addresses, and 0-128 for IPv6 addresses.
| |
| getNetworkAddress | back to summary |
|---|---|
| public InetAddress getNetworkAddress() Get the network address. The returned address has a resolved name consisting of the most compact valid string representation of the network of this CIDR address.
| |
| getScopeId | back to summary |
|---|---|
| public int getScopeId() Get the match address scope ID (if it is an IPv6 address).
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| maskBits0 | back to summary |
|---|---|
| private static byte[] maskBits0(byte[] address, int bits) | |
| maskBits1 | back to summary |
|---|---|
| private static byte[] maskBits1(byte[] address, int bits) | |
| matches | back to summary |
|---|---|
| public boolean matches(InetAddress address) Determine if this CIDR address matches the given address.
| |
| matches | back to summary |
|---|---|
| public boolean matches(byte[] bytes) Determine if this CIDR address matches the given address bytes.
| |
| matches | back to summary |
|---|---|
| public boolean matches(byte[] bytes, int scopeId) Determine if this CIDR address matches the given address bytes.
| |
| matches | back to summary |
|---|---|
| public boolean matches(Inet4Address address) Determine if this CIDR address matches the given address.
| |
| matches | back to summary |
|---|---|
| public boolean matches(Inet6Address address) Determine if this CIDR address matches the given address.
| |
| matches | back to summary |
|---|---|
| public boolean matches(CidrAddress address) Determine if this CIDR address matches the given CIDR address. This will be true only when the given CIDR block is wholly enclosed by this one.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
| writeReplace | back to summary |
|---|---|
| pack-priv Object writeReplace() Returns the serialization replacement for this object.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final byte[] | |
| pack-priv final int | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv Object |
| b | back to summary |
|---|---|
| pack-priv final byte[] b | |
| m | back to summary |
|---|---|
| pack-priv final int m | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| Ser | back to summary |
|---|---|
| pack-priv Ser(final byte[] b, final int m) | |
| readResolve | back to summary |
|---|---|
| pack-priv Object readResolve() | |