public interface IPSubnet<T extends IPAddress & java.lang.Comparable<T>>
extends java.lang.Iterable<T>
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(IPRange<T> range)
Checks whether this subnet contains all addresses of a given range.
|
boolean |
contains(T ip)
Checks whether a given address is inside this subnet
|
T |
getFirst()
Returns the network address, same as
getNetworkAddress() |
int |
getHostBitCount()
Returns the number of bits used for the host part of the address.
|
T |
getLast()
Returns the last address in the subnet
|
T |
getNetworkAddress()
Returns the address of the network (with all host bits set to zero) same
as
getFirst() |
int |
getNetworkBitCount()
Returns the number of bits used for the network address.
|
T |
getNetworkMask()
Returns the network mask in address form
|
java.util.Iterator<T> |
iterator(boolean trim)
Returns an iterator that optionally skips both the first and last
addresses in the subnet
|
java.util.Iterator<T> |
iterator(boolean skipFirst,
boolean skipLast)
Returns an iterator that optionally skips the first, last or both
addresses in the subnet
|
java.lang.Number |
length()
Returns the number of addresses in the subnet
|
boolean |
overlaps(IPRange<T> range)
Checks whether this subnet has any overlapping addresses with a given
range.
|
T getNetworkMask()
int getNetworkBitCount()
int getHostBitCount()
T getNetworkAddress()
getFirst()boolean overlaps(IPRange<T> range)
contains(IPRange)range - the range to check for overlapboolean contains(T ip)
ip - boolean contains(IPRange<T> range)
overlaps(IPRange)range - range to checkT getFirst()
getNetworkAddress()T getLast()
java.util.Iterator<T> iterator(boolean trim)
trim - set to true to skip first and last addressesjava.util.Iterator<T> iterator(boolean skipFirst, boolean skipLast)
skipFirst - set to true to skip the first addressskipLast - set to true to skip the last addressesjava.lang.Number length()