Package org.drasyl.util.network
Class Subnet
java.lang.Object
org.drasyl.util.network.Subnet
Represents an IP range..
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddress()
boolean
contains
(InetAddress address) Returnstrue
ifaddress
is part of this subnet.first()
Returns the firstInetAddress
of this subnetwork.last()
Returns the lastInetAddress
of this subnetwork.netmask()
int
network()
int
Returns the size of this subnetwork.nth
(int n) Returns then
-thInetAddress
of this subnetwork.toString()
-
Constructor Details
-
Subnet
- Parameters:
subnet
- subnet in CIDR notation- Throws:
UnknownHostException
-
-
Method Details
-
toString
-
address
-
netmaskLength
public int netmaskLength() -
network
-
netmask
-
networkSize
public int networkSize()Returns the size of this subnetwork. -
nth
Returns then
-thInetAddress
of this subnetwork. -
first
Returns the firstInetAddress
of this subnetwork. -
last
Returns the lastInetAddress
of this subnetwork. -
contains
Returnstrue
ifaddress
is part of this subnet.
-