public abstract class IPAddressDivision extends java.lang.Object implements java.lang.Comparable<IPAddressDivision>, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static boolean |
ADJUST_RANGES_BY_PREFIX |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(IPAddressDivision other) |
static int |
defaultMaxCharsPerSegment(IPAddress.IPVersion version) |
abstract int |
getBitCount() |
abstract int |
getByteCount() |
static int |
getCharWidth(long value,
int radix) |
long |
getCount() |
abstract int |
getDefaultMaxChars() |
int |
getDefaultMaxChars(int radix) |
abstract int |
getDefaultTextualRadix() |
java.lang.Integer |
getDivisionPrefixLength()
Returns the network prefix for the division.
|
abstract long |
getLowerValue() |
java.lang.Integer |
getMaskPrefixLength(boolean network)
If this is equivalent to the mask for a CIDR prefix, it returns that prefix length.
|
int |
getMaxLeadingZeros(int radix) |
int |
getPrefixAdjustedWildcardString(IPAddressSection.WildcardOptions.Wildcards wildcards,
int leadingZeroCount,
java.lang.String stringPrefix,
int radix,
boolean uppercase,
java.lang.StringBuilder appendable)
Produces a string to represent the segment.
|
java.lang.String |
getString()
Produces a normalized string to represent the segment.
|
abstract long |
getUpperValue() |
java.lang.String |
getWildcardString()
Produces a string to represent the segment, favouring wildcards and range characters over the network prefix to represent subnets.
|
int |
getWildcardString(IPAddressSection.WildcardOptions.Wildcards wildcards,
int leadingZeroCount,
java.lang.String stringPrefix,
int radix,
boolean uppercase,
boolean splitDigits,
char splitDigitSeparator,
boolean reverseSplitDigits,
java.lang.StringBuilder appendable)
Produces a string to represent the segment, favouring wildcards and range characters over the network prefix to represent subnets.
|
boolean |
hasAlphabeticDigits(int base,
boolean lowerOnly) |
boolean |
isFullRange() |
boolean |
isMaskCompatibleWithRange(long maskValue,
java.lang.Integer divisionPrefixLen) |
boolean |
isMultiple() |
boolean |
isPrefixed() |
boolean |
isRangeEquivalent(java.lang.Integer divisionPrefixLen) |
boolean |
isRangeEquivalentToPrefix() |
boolean |
isRangeUnchanged(java.lang.Integer divisionPrefixLen) |
boolean |
isSamePrefixedRange(long lowerValue) |
boolean |
isZero() |
boolean |
matches(long value) |
boolean |
matchesWithMask(int value,
long mask) |
boolean |
matchesWithPrefix(long value,
java.lang.Integer divisionPrefixLen) |
boolean |
rangeIsWithin(long lower,
long upper) |
java.lang.String |
toString() |
boolean |
valueIsWithin(long lower,
long upper) |
public static final boolean ADJUST_RANGES_BY_PREFIX
public boolean isMultiple()
public abstract int getBitCount()
public abstract int getByteCount()
public boolean isPrefixed()
public java.lang.Integer getDivisionPrefixLength()
public boolean isZero()
public abstract long getLowerValue()
public abstract long getUpperValue()
public long getCount()
public boolean rangeIsWithin(long lower, long upper)
public boolean valueIsWithin(long lower, long upper)
public boolean matches(long value)
public boolean matchesWithPrefix(long value, java.lang.Integer divisionPrefixLen)
public boolean matchesWithMask(int value, long mask)
public java.lang.Integer getMaskPrefixLength(boolean network)
network
- whether to check for a network mask or a host maskIPAddressSection.getEquivalentPrefix()
public boolean isSamePrefixedRange(long lowerValue)
lowerValue
- public boolean isRangeEquivalent(java.lang.Integer divisionPrefixLen)
divisionPrefixLen
- public boolean isRangeUnchanged(java.lang.Integer divisionPrefixLen)
divisionPrefixLen
- public boolean isRangeEquivalentToPrefix()
public boolean isFullRange()
public boolean isMaskCompatibleWithRange(long maskValue, java.lang.Integer divisionPrefixLen)
public int compareTo(IPAddressDivision other)
compareTo
in interface java.lang.Comparable<IPAddressDivision>
public abstract int getDefaultTextualRadix()
public abstract int getDefaultMaxChars()
public boolean hasAlphabeticDigits(int base, boolean lowerOnly)
public static int defaultMaxCharsPerSegment(IPAddress.IPVersion version)
public int getDefaultMaxChars(int radix)
public static int getCharWidth(long value, int radix)
public int getMaxLeadingZeros(int radix)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getString()
public java.lang.String getWildcardString()
public int getWildcardString(IPAddressSection.WildcardOptions.Wildcards wildcards, int leadingZeroCount, java.lang.String stringPrefix, int radix, boolean uppercase, boolean splitDigits, char splitDigitSeparator, boolean reverseSplitDigits, java.lang.StringBuilder appendable)
public int getPrefixAdjustedWildcardString(IPAddressSection.WildcardOptions.Wildcards wildcards, int leadingZeroCount, java.lang.String stringPrefix, int radix, boolean uppercase, java.lang.StringBuilder appendable)
Use this instead of #getWildcardString(Wildcards, int, String, int, boolean, StringBuilder)
if you wish to avoid printing wildcards in the host section of the address.
Use this instead of getString() if you have a customized wildcard or range separator or you have a non-zero leadingZeroCount, or you have a string prefix, or you have a non-default radix (for IPv4 default radix is 10, for IPv6 it is 16)