public class Subnet extends Object
| Constructor and Description |
|---|
Subnet(InetAddress subnet,
int mask)
Creates a subnet from CIDR notation.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
boolean |
inSubnet(InetAddress address)
Checks if the
InetAddress is within this subnet |
String |
toString() |
public Subnet(InetAddress subnet, int mask)
InetAddress
192.168.0.0 and the mask 24.subnet - The InetAddress of the subnetmask - The maskpublic boolean inSubnet(InetAddress address)
InetAddress is within this subnetaddress - The InetAddress to checkpublic String toString()
toString in class ObjectObject.toString()