public abstract class AddressDivision extends AddressDivisionBase
| Modifier and Type | Class and Description |
|---|---|
static class |
AddressDivision.BitwiseOrResult
Represents the result of a bitwise or of a sequential range of values
|
static class |
AddressDivision.MaskResult
Represents the result of masking a sequential range of values
|
EXTENDED_DIGITS| Modifier and Type | Method and Description |
|---|---|
static AddressDivision.BitwiseOrResult |
bitwiseOrRange(long value,
long upperValue,
long maskValue)
Applies bitwise or to a range of values.
|
boolean |
equals(Object o)
Two divisions are equal if they:
- they match type/version (ipv4, ipv6, mac, or a specific division class)
- match bit counts
- match values
Prefix lengths, for those divisions that have them, are ignored.
|
int |
getDigitCount(int radix)
Returns the count of digits of the value, or if a range, the larger value in the range
|
abstract long |
getDivisionValue() |
int |
getMaxDigitCount(int radix)
Returns the count of digits of the largest possible value
|
long |
getMaxValue() |
int |
getMinPrefixLengthForBlock()
Returns the smallest prefix length possible such that this item includes the block of all values for that prefix length.
|
Integer |
getPrefixLengthForSingleBlock()
Returns a prefix length for which the range of this item matches the block of all values for that prefix length.
|
abstract long |
getUpperDivisionValue() |
BigInteger |
getUpperValue()
Returns the highest value represented by this address item, the highest value included in the range of values
|
BigInteger |
getValue()
Returns the lowest value represented by this address item, the lowest value included in the range of values
|
int |
hashCode()
Returns a hash code value for the object.
|
boolean |
hasUppercaseVariations(int radix,
boolean lowerOnly) |
boolean |
includesMax()
Returns whether this item includes the maximum possible value for the address type or version within its range
|
boolean |
includesZero()
Returns whether this item includes the value of zero within its range
|
boolean |
isBitwiseOrCompatibleWithRange(int maskValue)
Similar to masking, checks that the range resulting from the bitwise "or" operation is sequential.
|
boolean |
isBoundedBy(int value)
Returns true if the possible values of this division fall below the given value.
|
boolean |
isMaskCompatibleWithRange(int maskValue)
Check that the range resulting from the mask is contiguous, otherwise it cannot be represented by a division or segment instance.
|
boolean |
isMax()
Returns whether this item matches the maximum possible value for the address type or version
|
boolean |
isMultiple()
Whether this represents multiple potential values (eg a prefixed address or a segment representing a range of values)
|
boolean |
isZero()
Returns whether this item matches the value of zero
|
static AddressDivision.MaskResult |
maskRange(long value,
long upperValue,
long maskValue)
Returns an object that provides the masked values for a range,
which for subnets is an aggregation of all masked individual addresses in the subnet.
|
boolean |
matches(long value) |
boolean |
matchesWithMask(long value,
long mask) |
boolean |
matchesWithMask(long lowerValue,
long upperValue,
long mask)
returns whether masking with the given mask results in a valid contiguous range for this segment,
and if it does, if it matches the range obtained when masking the given values with the same mask.
|
getBytes, getBytes, getBytes, getDigitCount, getLowerStandardString, getStandardString, getUpperBytes, getUpperBytes, getUpperBytes, toStringcompareTo, containsPrefixBlock, containsSinglePrefixBlock, getBitCount, getByteCount, getCount, getPrefixCount, isFullRangepublic boolean isMultiple()
AddressItempublic int getMinPrefixLengthForBlock()
AddressItem
If the entire range can be dictated this way, then this method returns the same value as AddressItem.getPrefixLengthForSingleBlock().
Otherwise, this method will return the minimal possible prefix that can be paired with this address, while AddressItem.getPrefixLengthForSingleBlock() will return null.
In cases where the final bit is constant so there is no such block, this returns the bit count.
public Integer getPrefixLengthForSingleBlock()
AddressItem
If the range can be dictated this way, then this method returns the same value as AddressItem.getMinPrefixLengthForBlock().
If no such prefix length exists, returns null.
If this item represents a single value, this returns the bit count.
public long getMaxValue()
public boolean isZero()
AddressItempublic boolean includesZero()
AddressItempublic boolean isMax()
AddressItempublic boolean includesMax()
AddressItempublic abstract long getDivisionValue()
public abstract long getUpperDivisionValue()
public int hashCode()
java.lang.ObjectHashMap.
The general contract of hashCode is:
hashCode method
must consistently return the same integer, provided no information
used in equals comparisons on the object is modified.
This integer need not remain consistent from one execution of an
application to another execution of the same application.
equals(Object)
method, then calling the hashCode method on each of
the two objects must produce the same integer result.
Object.equals(java.lang.Object)
method, then calling the hashCode method on each of the
two objects must produce distinct integer results. However, the
programmer should be aware that producing distinct integer results
for unequal objects may improve the performance of hash tables.
As much as is reasonably practical, the hashCode method defined by
class Object does return distinct integers for distinct
objects. (This is typically implemented by converting the internal
address of the object into an integer, but this implementation
technique is not required by the
Java™ programming language.)
hashCode in class AddressDivisionBaseObject.equals(java.lang.Object),
System.identityHashCode(java.lang.Object)public BigInteger getValue()
AddressItempublic BigInteger getUpperValue()
AddressItempublic boolean isBoundedBy(int value)
public boolean matches(long value)
public boolean matchesWithMask(long value,
long mask)
public boolean matchesWithMask(long lowerValue,
long upperValue,
long mask)
lowerValue - upperValue - mask - public boolean equals(Object o)
AddressDivisionBaseequals in class AddressDivisionBaseo - the reference object with which to compare.true if this object is the same as the obj
argument; false otherwise.Object.hashCode(),
HashMappublic boolean isMaskCompatibleWithRange(int maskValue)
maskValue - public static AddressDivision.MaskResult maskRange(long value, long upperValue, long maskValue)
bitwiseOrRange(long, long, long)value - upperValue - maskValue - public boolean isBitwiseOrCompatibleWithRange(int maskValue)
maskValue - public static AddressDivision.BitwiseOrResult bitwiseOrRange(long value, long upperValue, long maskValue)
maskRange(long, long, long)maskValue - public boolean hasUppercaseVariations(int radix,
boolean lowerOnly)
public int getDigitCount(int radix)
AddressStringDivisionpublic int getMaxDigitCount(int radix)
AddressStringDivision