protected Object parseValue(String string){
  int openParen=string.indexOf("(");
  String type=string.substring(0,openParen);
  String value=string.substring(openParen + 1,string.length() - 1);
  if (type.equals("String")) {
    return value;
  }
 else   if (type.equals("Float")) {
    return new Float(Float.parseFloat(value));
  }
 else   if (type.equals("Integer")) {
    return new Integer(Integer.parseInt(value));
  }
 else   if (type.equals("List")) {
    StringTokenizer tok=new StringTokenizer(value,",");
    int size=tok.countTokens();
    int[] values=new int[size];
    for (int i=0; i < size; i++) {
      float fval=Float.parseFloat(tok.nextToken());
      values[i]=Math.round(fval);
    }
    return values;
  }
 else {
    throw new Error("Unknown type: " + type);
  }
}

protected Object parseValue ( String string ) { int openParen = string . indexOf ( "(" ) ; String type = string . substring ( 0 , openParen ) ; String value = string . substring ( openParen + 1 , string . length ( ) - 1 ) ; if ( type . equals ( "String" ) ) { return value ; } else if ( type . equals ( "Float" ) ) { return new Float ( Float . parseFloat ( value ) ) ; } else if ( type . equals ( "Integer" ) ) { return new Integer ( Integer . parseInt ( value ) ) ; } else if ( type . equals ( "List" ) ) { StringTokenizer tok = new StringTokenizer ( value , "," ) ; int size = tok . countTokens ( ) ; int [ ] values = new int [ size ] ; for ( int i = 0 ; i < size ; i ++ ) { float fval = Float . parseFloat ( tok . nextToken ( ) ) ; values [ i ] = Math . round ( fval ) ; } return values ; } else { throw new Error ( "Unknown type: " + type ) ; } }
coerces a string into a value .
