final void parseRange(String range){
  if (range == null) {
    throw new IllegalArgumentException("Invalid IP range");
  }
  int index=range.indexOf('/');
  String subnetStr=null;
  if (index == -1) {
    ipAddress=new IPAddress(range);
  }
 else {
    ipAddress=new IPAddress(range.substring(0,index));
    subnetStr=range.substring(index + 1);
  }
  try {
    if (subnetStr != null) {
      extendedNetworkPrefix=Integer.parseInt(subnetStr);
      if ((extendedNetworkPrefix < 0) || (extendedNetworkPrefix > 32)) {
        throw new IllegalArgumentException("Invalid IP range [" + range + "]");
      }
      ipSubnetMask=computeMaskFromNetworkPrefix(extendedNetworkPrefix);
    }
  }
 catch (  NumberFormatException ex) {
    ipSubnetMask=new IPAddress(subnetStr);
    extendedNetworkPrefix=computeNetworkPrefixFromMask(ipSubnetMask);
    if (extendedNetworkPrefix == -1) {
      throw new IllegalArgumentException("Invalid IP range [" + range + "]",ex);
    }
  }
}

final void parseRange ( String range ) { if ( range == null ) { throw new IllegalArgumentException ( "Invalid IP range" ) ; } int index = range . indexOf ( '/' ) ; String subnetStr = null ; if ( index == - 1 ) { ipAddress = new IPAddress ( range ) ; } else { ipAddress = new IPAddress ( range . substring ( 0 , index ) ) ; subnetStr = range . substring ( index + 1 ) ; } try { if ( subnetStr != null ) { extendedNetworkPrefix = Integer . parseInt ( subnetStr ) ; if ( ( extendedNetworkPrefix < 0 ) || ( extendedNetworkPrefix > 32 ) ) { throw new IllegalArgumentException ( "Invalid IP range [" + range + "]" ) ; } ipSubnetMask = computeMaskFromNetworkPrefix ( extendedNetworkPrefix ) ; } } catch ( NumberFormatException ex ) { ipSubnetMask = new IPAddress ( subnetStr ) ; extendedNetworkPrefix = computeNetworkPrefixFromMask ( ipSubnetMask ) ; if ( extendedNetworkPrefix == - 1 ) { throw new IllegalArgumentException ( "Invalid IP range [" + range + "]" , ex ) ; } } }
parse the ip range string representation .
