public class IpRange
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected byte[] |
addressFrom |
protected byte[] |
addressTo |
Constructor and Description |
---|
IpRange() |
IpRange(byte[] addressFrom,
byte[] addressTo) |
Modifier and Type | Method and Description |
---|---|
byte[] |
getAddressFrom() |
byte[] |
getAddressTo() |
static boolean |
inRange(byte[] addressFrom1,
byte[] addressTo1,
byte[] addressFrom2,
byte[] addressTo2)
Входит ли первый диапазон во второй.
|
static boolean |
intersects(byte[] addressFrom1,
byte[] addressTo1,
byte[] addressFrom2,
byte[] addressTo2)
Пересекаются ли данные диапазоны.
|
static IpRange |
newInstance(byte[] subnet,
byte[] mask) |
static IpRange |
newInstance(byte[] subnet,
int mask)
Создает новый диапазон из подсети
|
static IpRange |
newInstance(IpNet net)
Создает новый диапазон из подсети.
|
void |
setAddressFrom(byte[] ipFrom) |
void |
setAddressTo(byte[] ipTo) |
java.lang.String |
toString() |
static java.lang.String |
toString(byte[] addressFrom,
byte[] addressTo)
Возвращает строковое представление диапазона.
|
static java.lang.String |
toString(IpAddress addressFrom,
IpAddress addressTo)
Возвращает строковое представление диапазона.
|
public IpRange()
public IpRange(byte[] addressFrom, byte[] addressTo)
public byte[] getAddressFrom()
public void setAddressFrom(byte[] ipFrom)
public byte[] getAddressTo()
public void setAddressTo(byte[] ipTo)
public java.lang.String toString()
toString
in class java.lang.Object
public static java.lang.String toString(IpAddress addressFrom, IpAddress addressTo)
IpAddress.toString(byte[])
от addressFrom.addressFrom
- начало диапазонаaddressTo
- конец диапазонаpublic static java.lang.String toString(byte[] addressFrom, byte[] addressTo)
IpAddress.toString(byte[])
от addressFrom.addressFrom
- начало диапазонаaddressTo
- конец диапазонаpublic static IpRange newInstance(byte[] subnet, int mask)
subnet
- mask
- public static IpRange newInstance(IpNet net)
net
- public static IpRange newInstance(byte[] subnet, byte[] mask)
public static boolean intersects(byte[] addressFrom1, byte[] addressTo1, byte[] addressFrom2, byte[] addressTo2)
addressFrom1
- addressTo2
- addressFrom2
- addressTo2
- public static boolean inRange(byte[] addressFrom1, byte[] addressTo1, byte[] addressFrom2, byte[] addressTo2)
addressFrom1
- addressTo2
- addressFrom2
- addressTo2
-