/** * 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. */ public long getAddressCountLong() { long b = broadcastLong(); long n = networkLong(); long count = b - n + (isInclusiveHostCount() ? 1 : -1); return count < 0 ? 0 : count; }
/** * Returns true if the parameter <code>address</code> is in the * range of usable endpoint addresses for this subnet. This excludes the * network and broadcast adresses. * @param address A dot-delimited IPv4 address, e.g. "192.168.0.1" * @return True if in range, false otherwise */ public boolean isInRange(String address) { return isInRange(toInteger(address)); }
public boolean match(String address) { if( ! SubnetV4Utils.isAddress(address)) return false; SubnetV4Utils su = new SubnetV4Utils(low, size); return su.getInfo().isInRange(address); }
private int low() { return (isInclusiveHostCount() ? network() : broadcastLong() - networkLong() > 1 ? network() + 1 : 0); }
private int high() { return (isInclusiveHostCount() ? broadcast() : broadcastLong() - networkLong() > 1 ? broadcast() -1 : 0); }
protected String encodeIPv4() { SubnetV4Utils su = new SubnetV4Utils(low, size); return su.getInfo().getAddress(); }
public boolean match(String address) { if( ! SubnetV4Utils.isAddress(address)) return false; SubnetV4Utils su = new SubnetV4Utils(low, size); return su.getInfo().isInRange(address); }
private int low() { return (isInclusiveHostCount() ? network() : broadcastLong() - networkLong() > 1 ? network() + 1 : 0); }
/** * 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. */ public long getAddressCountLong() { long b = broadcastLong(); long n = networkLong(); long count = b - n + (isInclusiveHostCount() ? 1 : -1); return count < 0 ? 0 : count; }
private int high() { return (isInclusiveHostCount() ? broadcast() : broadcastLong() - networkLong() > 1 ? broadcast() -1 : 0); }
/** * Returns true if the parameter <code>address</code> is in the * range of usable endpoint addresses for this subnet. This excludes the * network and broadcast adresses. * @param address A dot-delimited IPv4 address, e.g. "192.168.0.1" * @return True if in range, false otherwise */ public boolean isInRange(String address) { return isInRange(toInteger(address)); }
public boolean match(String address) { if( ! SubnetV4Utils.isAddress(address)) return false; SubnetV4Utils su = new SubnetV4Utils(low, size); return su.getInfo().isInRange(address); }
private int low() { return (isInclusiveHostCount() ? network() : broadcastLong() - networkLong() > 1 ? network() + 1 : 0); }
/** * 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. */ public long getAddressCountLong() { long b = broadcastLong(); long n = networkLong(); long count = b - n + (isInclusiveHostCount() ? 1 : -1); return count < 0 ? 0 : count; }
/** * Returns true if the parameter <code>address</code> is in the * range of usable endpoint addresses for this subnet. This excludes the * network and broadcast adresses. * @param address A dot-delimited IPv4 address, e.g. "192.168.0.1" * @return True if in range, false otherwise */ public boolean isInRange(String address) { return isInRange(toInteger(address)); }
public boolean match(String address) { if( ! SubnetV4Utils.isAddress(address)) return false; SubnetV4Utils su = new SubnetV4Utils(low, size); return su.getInfo().isInRange(address); }
/** * 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. */ public long getAddressCountLong() { long b = broadcastLong(); long n = networkLong(); long count = b - n + (isInclusiveHostCount() ? 1 : -1); return count < 0 ? 0 : count; }
/** * Returns true if the parameter <code>address</code> is in the * range of usable endpoint addresses for this subnet. This excludes the * network and broadcast adresses. * @param address A dot-delimited IPv4 address, e.g. "192.168.0.1" * @return True if in range, false otherwise */ public boolean isInRange(String address) { return isInRange(toInteger(address)); }