Package org.drasyl.util.network
Class Subnet
java.lang.Object
org.drasyl.util.network.Subnet
Represents an IP range..
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddress()booleancontains(InetAddress address) Returnstrueifaddressis part of this subnet.first()Returns the firstInetAddressof this subnetwork.last()Returns the lastInetAddressof this subnetwork.netmask()intnetwork()intReturns the size of this subnetwork.nth(int n) Returns then-thInetAddressof 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-thInetAddressof this subnetwork. -
first
Returns the firstInetAddressof this subnetwork. -
last
Returns the lastInetAddressof this subnetwork. -
contains
Returnstrueifaddressis part of this subnet.
-