@Test public void testSubtract() throws Exception { assertSubtract("192.168.1.43", "192.168.1.19", "24"); assertSubtract("fe80::20e:cff:fe33:d204", "fe80::20e:c00:fe33:d204", "1095216660480"); assertSubtract("fe80::20e:cff:0033:d204", "fe80::20e:cff:fe33:d204", "-4261412864"); assertSubtract("fe80::20e:cff:fe33:d204", "fe00::20e:cff:fe33:d204", "664613997892457936451903530140172288"); assertSubtract("fe80::20e:cff:fe33:d204", null, null); }
public BigInteger subtract(IPTarget ip) { if(ip == null) { return null; } if(this.v6 != ip.v6) { throw new IllegalArgumentException("Cannot subtract IPTarget value " + ip + " from " + this + " - different sizes"); } BigInteger a = new BigInteger(1, this.addr); BigInteger b = new BigInteger(1, ip.addr); return a.subtract(b); }
IPTarget extends PGinet implements Serializable, Cloneable, Comparable<IPTarget> { public BigInteger subtract(IPTarget ip) { if(ip == null) { return null; } if(this.v6 != ip.v6) { throw new IllegalArgumentException("Cannot subtract IPTarget value " + ip + " from " + this + " - different sizes"); } BigInteger a = new BigInteger(1, this.addr); BigInteger b = new BigInteger(1, ip.addr); return a.subtract(b); } }
IPTarget extends PGinet implements Serializable, Cloneable, Comparable<IPTarget> { public BigInteger subtract(IPTarget ip) { if(ip == null) { return null; } if(this.v6 != ip.v6) { throw new IllegalArgumentException("Cannot subtract IPTarget value " + ip + " from " + this + " - different sizes"); } BigInteger a = new BigInteger(1, this.addr); BigInteger b = new BigInteger(1, ip.addr); return a.subtract(b); } IPTarget();  IPTarget(PGinet ip);  IPTarget(byte[] address);  IPTarget(String ip); }
IPTarget extends PGinet implements Serializable, Cloneable, Comparable<IPTarget> { public BigInteger subtract(IPTarget ip) { if(ip == null) { return null; } if(this.v6 != ip.v6) { throw new IllegalArgumentException("Cannot subtract IPTarget value " + ip + " from " + this + " - different sizes"); } BigInteger a = new BigInteger(1, this.addr); BigInteger b = new BigInteger(1, ip.addr); return a.subtract(b); } IPTarget();  IPTarget(PGinet ip);  IPTarget(byte[] address);  IPTarget(String ip); final void init(); @Override void setValue(String v); InetAddress getHost(); byte[] getAddr(); void setHost(InetAddress host); boolean isV6(); void setV6(boolean v6); @Override boolean equals(Object obj); @Override int hashCode(); @Override int compareTo(IPTarget o); byte[] getMAC(); InetAddress getUnicastPrefixMCAddress(); IPTarget getPrevious(); IPTarget getNext(); IPTarget getEmbeddedIPv4(); BigInteger subtract(IPTarget ip); IPTarget subtract(BigInteger offset); IPTarget subtract(long offset); IPTarget add(BigInteger offset); IPTarget add(long offset); boolean isMulticast(); boolean isMulticastGlobal(); boolean isMulticastLinkLocal(); boolean isMulticastNodeLocal(); boolean isMulticastOrgLocal(); boolean isMulticastSiteLocal(); boolean isLinkLocal(); boolean isAnyLocal(); boolean isLoopback(); @Override String toString(); }
IPTarget extends PGinet implements Serializable, Cloneable, Comparable<IPTarget> { public BigInteger subtract(IPTarget ip) { if(ip == null) { return null; } if(this.v6 != ip.v6) { throw new IllegalArgumentException("Cannot subtract IPTarget value " + ip + " from " + this + " - different sizes"); } BigInteger a = new BigInteger(1, this.addr); BigInteger b = new BigInteger(1, ip.addr); return a.subtract(b); } IPTarget();  IPTarget(PGinet ip);  IPTarget(byte[] address);  IPTarget(String ip); final void init(); @Override void setValue(String v); InetAddress getHost(); byte[] getAddr(); void setHost(InetAddress host); boolean isV6(); void setV6(boolean v6); @Override boolean equals(Object obj); @Override int hashCode(); @Override int compareTo(IPTarget o); byte[] getMAC(); InetAddress getUnicastPrefixMCAddress(); IPTarget getPrevious(); IPTarget getNext(); IPTarget getEmbeddedIPv4(); BigInteger subtract(IPTarget ip); IPTarget subtract(BigInteger offset); IPTarget subtract(long offset); IPTarget add(BigInteger offset); IPTarget add(long offset); boolean isMulticast(); boolean isMulticastGlobal(); boolean isMulticastLinkLocal(); boolean isMulticastNodeLocal(); boolean isMulticastOrgLocal(); boolean isMulticastSiteLocal(); boolean isLinkLocal(); boolean isAnyLocal(); boolean isLoopback(); @Override String toString(); static final InetAddress MAX_V4_ADDRESS; static final BigInteger MAX_V4_VALUE; static final InetAddress MAX_V6_ADDRESS; static final BigInteger MAX_V6_VALUE; }