public class IP4AddressMask extends Object implements IPAddressMask
Modifier and Type | Class and Description |
---|---|
static class |
IP4AddressMask.IP4Mask |
Constructor and Description |
---|
IP4AddressMask(Inet4Address address,
int mask)
Creates a new IP4 address mask.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(InetAddress address)
Checks whether a given IP address is part of this IP address range.
|
boolean |
equals(Object obj) |
InetAddress |
first() |
InetAddress |
getAddress() |
byte[] |
getMask() |
int |
hashCode() |
InetAddress |
last() |
String |
toString()
Mask as a String in the form of "
190.10.1.0/24 ". |
public IP4AddressMask(Inet4Address address, int mask)
address
- Base IP4 address of the IP address mask.mask
- subnet mask length to be applied. Must be a value between 0 and 32.public byte[] getMask()
getMask
in interface IPAddressMask
public InetAddress getAddress()
getAddress
in interface IPAddressMask
public String toString()
190.10.1.0/24
".toString
in class Object
Object.toString()
public boolean contains(InetAddress address)
IPRange
public InetAddress first()
public InetAddress last()
Copyright © 2004–2018 52north.org. All rights reserved.