private static double parseResizeWeight(String token){
  if (token.equals("g") || token.equals("grow")) {
    return DEFAULT_GROW;
  }
  if (token.equals("n") || token.equals("nogrow") || token.equals("none")) {
    return NO_GROW;
  }
  if ((token.startsWith("grow(") || token.startsWith("g(")) && token.endsWith(")")) {
    int leftParen=token.indexOf('(');
    int rightParen=token.indexOf(')');
    String substring=token.substring(leftParen + 1,rightParen);
    return Double.parseDouble(substring);
  }
  throw new IllegalArgumentException("The resize argument '" + token + "' is invalid. "+ " Must be one of: grow, g, none, n, grow(<double>), g(<double>)");
}

private static double parseResizeWeight ( String token ) { if ( token . equals ( "g" ) || token . equals ( "grow" ) ) { return DEFAULT_GROW ; } if ( token . equals ( "n" ) || token . equals ( "nogrow" ) || token . equals ( "none" ) ) { return NO_GROW ; } if ( ( token . startsWith ( "grow(" ) || token . startsWith ( "g(" ) ) && token . endsWith ( ")" ) ) { int leftParen = token . indexOf ( '(' ) ; int rightParen = token . indexOf ( ')' ) ; String substring = token . substring ( leftParen + 1 , rightParen ) ; return Double . parseDouble ( substring ) ; } throw new IllegalArgumentException ( "The resize argument '" + token + "' is invalid. " + " Must be one of: grow, g, none, n, grow(<double>), g(<double>)" ) ; }
decodes an encoded resize mode and resize weight and answers the resize weight .
