コード例 #1
0
 @Override
 public void setOptions(List<Object> OptionsObj) throws Exception {
   String[] Options = CommandHandler.convertCommandToString(OptionsObj);
   try {
     NToSelect = Integer.parseInt(Options[0]);
     if (Options[1].equalsIgnoreCase("?")) {
       System.out.println("Available Attribute Evaluators:");
       CommandHandler.printImplmentingClasses(BaseAttributeEvaluator.class, false);
       return;
     }
     String Method = Options[1];
     List<Object> MethodOptions = OptionsObj.subList(2, OptionsObj.size());
     Evaluator =
         (BaseAttributeEvaluator)
             CommandHandler.instantiateClass("attributes.evaluators." + Method, MethodOptions);
   } catch (OutOfRangeException e) {
     throw new Exception(printUsage());
   } catch (Exception e) {
     throw e;
   }
 }
コード例 #2
0
  @Override
  public void setOptions(List<Object> OptionsObj) throws Exception {
    String[] Options = CommandHandler.convertCommandToString(OptionsObj);
    try {
      if (Options[0].equalsIgnoreCase("predicted")) useMeasured = false;
      else if (Options[0].equalsIgnoreCase("measured")) useMeasured = true;
      else throw new Exception();

      if (Options[1].equalsIgnoreCase("inside")) insideRange = true;
      else if (Options[1].equalsIgnoreCase("outside")) insideRange = false;
      else throw new Exception();

      lowerBound = Double.parseDouble(Options[2]);
      upperBound = Double.parseDouble(Options[3]);
      if (lowerBound >= upperBound) throw new Exception();
    } catch (Exception e) {
      throw new Exception(printUsage());
    }
  }