| Constructor and Description |
|---|
IPAddressRange(IPAddress address,
int prefix)
Creates a new address range from the an address and an prefix.
|
IPAddressRange(IPAddress address,
IPAddress mask)
Creates a new address range from an address an a subnet mask.
|
IPAddressRange(String string)
Creates a new address range from its string representation.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
apply(IPAddress input)
Deprecated.
|
com.google.common.collect.Range<IPAddress> |
asRange() |
boolean |
contains(IPAddress ip)
Checks if a given IP address is in this range.
|
boolean |
equals(Object obj) |
IPAddress |
getAddress() |
IPAddress |
getHigh() |
IPAddress |
getLow() |
IPAddress |
getMask()
Get the mask described by this prefix.
|
(package private) static IPAddress |
getMaskForPrefix(int prefix,
int numBits) |
int |
getPrefix() |
(package private) static int |
getPrefixForMask(IPAddress mask) |
int |
hashCode() |
boolean |
isIPv4()
Checks if this address range is IPv4.
|
boolean |
isIPv6()
Checks if this address range is IPv6.
|
boolean |
test(IPAddress input) |
String |
toString() |
public IPAddressRange(String string)
192.168.1.1/24 192.168.1.1/255.255.255.0 2001:db8:abcd:0012::0/64 2001:db8:abcd:0012::0/ffff:ffff:ffff:ffff::
string - the string representationpublic IPAddressRange(IPAddress address, IPAddress mask)
address - the addressmask - the subnet maskpublic IPAddressRange(IPAddress address, int prefix)
address - the addressprefix - the prefixpublic boolean isIPv4()
public boolean isIPv6()
public IPAddress getAddress()
public int getPrefix()
public IPAddress getMask()
public IPAddress getHigh()
public IPAddress getLow()
public boolean contains(IPAddress ip)
ip - the addresspublic com.google.common.collect.Range<IPAddress> asRange()
Range@Deprecated public boolean apply(IPAddress input)
static int getPrefixForMask(IPAddress mask)
static IPAddress getMaskForPrefix(int prefix, int numBits)
Copyright © 2015–2020 52°North Initiative for Geospatial Open Source Software GmbH. All rights reserved.