class Const {

  public static long toLong( String str, long def ) {
    long retval;
    try {
      retval = Long.parseLong( str );
    } catch ( Exception e ) {
      retval = def;
    }
    return retval;
  }

}