private long stringToIp(String ip) throws PolicyException {
  StringTokenizer st=new StringTokenizer(ip,".");
  int tokenCount=st.countTokens();
  if (tokenCount != 4) {
    String args[]={"ip",ip};
    throw new PolicyException(ResBundleUtils.rbName,"invalid_property_value",args,null);
  }
  long ipValue=0L;
  while (st.hasMoreElements()) {
    String s=st.nextToken();
    short ipElement=0;
    try {
      ipElement=Short.parseShort(s);
    }
 catch (    Exception e) {
      String args[]={"ip",ip};
      throw new PolicyException(ResBundleUtils.rbName,"invalid_property_value",args,null);
    }
    if (ipElement < 0 || ipElement > 255) {
      String args[]={"ipElement",s};
      throw new PolicyException(ResBundleUtils.rbName,"invalid_property_value",args,null);
    }
    ipValue=ipValue * 256L + ipElement;
  }
  return ipValue;
}

private long stringToIp ( String ip ) throws PolicyException { StringTokenizer st = new StringTokenizer ( ip , "." ) ; int tokenCount = st . countTokens ( ) ; if ( tokenCount != 4 ) { String args [ ] = { "ip" , ip } ; throw new PolicyException ( ResBundleUtils . rbName , "invalid_property_value" , args , null ) ; } long ipValue = 0L ; while ( st . hasMoreElements ( ) ) { String s = st . nextToken ( ) ; short ipElement = 0 ; try { ipElement = Short . parseShort ( s ) ; } catch ( Exception e ) { String args [ ] = { "ip" , ip } ; throw new PolicyException ( ResBundleUtils . rbName , "invalid_property_value" , args , null ) ; } if ( ipElement < 0 || ipElement > 255 ) { String args [ ] = { "ipElement" , s } ; throw new PolicyException ( ResBundleUtils . rbName , "invalid_property_value" , args , null ) ; } ipValue = ipValue * 256L + ipElement ; } return ipValue ; }
converts string represenration of ip address to a long .
