public CIDR(String cidrOrIP){
  String[] parts=cidrOrIP.split("/");
  if ((parts.length < 1) || (parts.length > 2))   throw new IllegalArgumentException(cidrOrIP + " does not represent an IP address or CIDR");
  bits=(1 == parts.length) ? 32 : Short.parseShort(parts[1]);
  if ((bits < 1) || (bits > 32))   throw new IllegalArgumentException(cidrOrIP + " does not represent an IP address or ICDR, /" + bits+ " is outside of [1:32]");
  this.firstIP=toIP(parts[0]);
}

public CIDR ( String cidrOrIP ) { String [ ] parts = cidrOrIP . split ( "/" ) ; if ( ( parts . length < 1 ) || ( parts . length > 2 ) ) throw new IllegalArgumentException ( cidrOrIP + " does not represent an IP address or CIDR" ) ; bits = ( 1 == parts . length ) ? 32 : Short . parseShort ( parts [ 1 ] ) ; if ( ( bits < 1 ) || ( bits > 32 ) ) throw new IllegalArgumentException ( cidrOrIP + " does not represent an IP address or ICDR, /" + bits + " is outside of [1:32]" ) ; this . firstIP = toIP ( parts [ 0 ] ) ; }
create a cidr from a string of the form " a . b . c . d " with an option " / n " suffix .
