private long parseIpAddressToLong(String address){
  long result=0;
  String[] parts=address.split("\\.");
  long shift=24;
  for (  String part : parts) {
    long lpart=Long.parseLong(part);
    result|=(lpart << shift);
    shift-=8;
  }
  return result;
}

private long parseIpAddressToLong ( String address ) { long result = 0 ; String [ ] parts = address . split ( "\\." ) ; long shift = 24 ; for ( String part : parts ) { long lpart = Long . parseLong ( part ) ; result |= ( lpart << shift ) ; shift -= 8 ; } return result ; }
convert a string representation of a ip to a long .
