/** * Get the count of available addresses. * Will be zero for CIDR/31 and CIDR/32 if the inclusive flag is false. * @return the count of addresses, may be zero. * @throws RuntimeException if the correct count is greater than {@code Integer.MAX_VALUE} * @deprecated use {@link #getAddressCountLong()} instead */ @Deprecated public int getAddressCount() { long countLong = getAddressCountLong(); if (countLong > Integer.MAX_VALUE) { throw new RuntimeException("Count is larger than an integer: " + countLong); } // N.B. cannot be negative return (int)countLong; }
/** * Get the count of available addresses. * Will be zero for CIDR/31 and CIDR/32 if the inclusive flag is false. * @return the count of addresses, may be zero. * @throws RuntimeException if the correct count is greater than {@code Integer.MAX_VALUE} * @deprecated use {@link #getAddressCountLong()} instead */ @Deprecated public int getAddressCount() { long countLong = getAddressCountLong(); if (countLong > Integer.MAX_VALUE) { throw new RuntimeException("Count is larger than an integer: " + countLong); } // N.B. cannot be negative return (int)countLong; }
/** * Get the count of available addresses. * Will be zero for CIDR/31 and CIDR/32 if the inclusive flag is false. * @return the count of addresses, may be zero. * @throws RuntimeException if the correct count is greater than {@code Integer.MAX_VALUE} * @deprecated use {@link #getAddressCountLong()} instead */ @Deprecated public int getAddressCount() { long countLong = getAddressCountLong(); if (countLong > Integer.MAX_VALUE) { throw new RuntimeException("Count is larger than an integer: " + countLong); } // N.B. cannot be negative return (int)countLong; }
/** * Get the count of available addresses. * Will be zero for CIDR/31 and CIDR/32 if the inclusive flag is false. * @return the count of addresses, may be zero. * @throws RuntimeException if the correct count is greater than {@code Integer.MAX_VALUE} * @deprecated use {@link #getAddressCountLong()} instead */ @Deprecated public int getAddressCount() { long countLong = getAddressCountLong(); if (countLong > Integer.MAX_VALUE) { throw new RuntimeException("Count is larger than an integer: " + countLong); } // N.B. cannot be negative return (int)countLong; }