/** * Find Find OptionSet with name * * @throws AutoException */ public OptionSet findOpset(String name) throws AutoException { for (OptionSet opset : this.OptionSet) { if (opset.getName().equals(name)) { return opset; } } throw new AutoException(EnumerationAutoException.WrongOptionSetName); }
public void printOneOption(String name) throws AutoException { OptionSet opset_find = this.findOpset(name); if (opset_find != null) { System.out.println(opset_find.getName() + ":"); opset_find.printAllOptions(); } else { System.out.println("Have no item named:" + name); } }
public void printOptions() { System.out.println("*************************************************************"); System.out.println("* Car's Options *"); System.out.println("*************************************************************"); int i = 1; for (OptionSet opt : this.OptionSet) { System.out.println("" + i + ". " + opt.getName() + ":"); opt.printAllOptions(); i++; } }