Package org.drasyl.util.network
Class Subnet
java.lang.Object
org.drasyl.util.network.Subnet
Represents an IP range..
- 
Constructor SummaryConstructors
- 
Method SummaryModifier 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
- 
netmaskLengthpublic int netmaskLength()
- 
network
- 
netmask
- 
networkSizepublic int networkSize()Returns the size of this subnetwork.
- 
nthReturns then-thInetAddressof this subnetwork.
- 
firstReturns the firstInetAddressof this subnetwork.
- 
lastReturns the lastInetAddressof this subnetwork.
- 
containsReturnstrueifaddressis part of this subnet.
 
-