/** * prints all the options to stdout */ protected static void printOptions(OptionHandler o) { Enumeration<Option> enm = o.listOptions(); System.out.println("Options for " + o.getClass().getName() + ":\n"); while (enm.hasMoreElements()) { Option option = enm.nextElement(); System.out.println(option.synopsis()); System.out.println(option.description()); } }
/** * prints all the options to stdout */ protected static void printOptions(OptionHandler o) { Enumeration<Option> enm = o.listOptions(); System.out.println("Options for " + o.getClass().getName() + ":\n"); while (enm.hasMoreElements()) { Option option = enm.nextElement(); System.out.println(option.synopsis()); System.out.println(option.description()); } }
/** * generates a string to print as help on the console * * @return the generated help */ public String generateHelp() { String result; Enumeration<Option> enm; Option option; result = getClass().getName().replaceAll(".*\\.", "") + " Options:\n\n"; enm = listOptions(); while (enm.hasMoreElements()) { option = enm.nextElement(); result += option.synopsis() + "\n" + option.description() + "\n"; } return result; }
/** * generates a string to print as help on the console * * @return the generated help */ public String generateHelp() { String result; Enumeration<Option> enm; Option option; result = getClass().getName().replaceAll(".*\\.", "") + " Options:\n\n"; enm = listOptions(); while (enm.hasMoreElements()) { option = enm.nextElement(); result += option.synopsis() + "\n" + option.description() + "\n"; } return result; }
/** * generates a string to print as help on the console * * @return the generated help */ public String generateHelp() { String result; Enumeration<Option> enm; Option option; result = getClass().getName().replaceAll(".*\\.", "") + " Options:\n\n"; enm = listOptions(); while (enm.hasMoreElements()) { option = enm.nextElement(); result += option.synopsis() + "\n" + option.description() + "\n"; } return result; }
/** * generates a string to print as help on the console * * @return the generated help */ public String generateHelp() { String result; Enumeration<Option> enm; Option option; result = getClass().getName().replaceAll(".*\\.", "") + " Options:\n\n"; enm = listOptions(); while (enm.hasMoreElements()) { option = enm.nextElement(); result += option.synopsis() + "\n" + option.description() + "\n"; } return result; }
/** * generates a string suitable for output on the command line displaying all * available options. * * @param saver the saver to create the option string for * @return the option string */ protected static String makeOptionStr(AbstractFileSaver saver) { StringBuffer result; Option option; result = new StringBuffer(); // build option string result.append("\n"); result.append(saver.getClass().getName().replaceAll(".*\\.", "")); result.append(" options:\n\n"); Enumeration<Option> enm = saver.listOptions(); while (enm.hasMoreElements()) { option = enm.nextElement(); result.append(option.synopsis() + "\n"); result.append(option.description() + "\n"); } return result.toString(); }
/** * Utility method to make a "help" options string for the supplied object (if * it is an OptionHandler) * * @param obj the object to create an options description for * @return the options description for the supplied object */ public static String makeOptionsStr(Object obj) { StringBuffer result = new StringBuffer(); Option option; // build option string result.append("\n"); result.append(obj.getClass().getName().replaceAll(".*\\.", "")); if (obj instanceof OptionHandler) { result.append(" options:\n\n"); Enumeration enm = ((OptionHandler) obj).listOptions(); while (enm.hasMoreElements()) { option = (Option) enm.nextElement(); result.append(option.synopsis() + "\n"); result.append(option.description() + "\n"); } } return result.toString(); }
/** * generates a string suitable for output on the command line displaying all * available options. * * @param saver the saver to create the option string for * @return the option string */ protected static String makeOptionStr(AbstractFileSaver saver) { StringBuffer result; Option option; result = new StringBuffer(); // build option string result.append("\n"); result.append(saver.getClass().getName().replaceAll(".*\\.", "")); result.append(" options:\n\n"); Enumeration<Option> enm = saver.listOptions(); while (enm.hasMoreElements()) { option = enm.nextElement(); result.append(option.synopsis() + "\n"); result.append(option.description() + "\n"); } return result.toString(); }
/** * generates the options string. * * @return the options string * @throws Exception in case the generation fails */ public String generate() throws Exception { StringBuffer result; OptionHandler handler; Enumeration<Option> enm; Option option; result = new StringBuffer(); handler = (OptionHandler) Utils.forName(null, getClassname(), new String[0]); enm = handler.listOptions(); while (enm.hasMoreElements()) { option = enm.nextElement(); result.append(option.synopsis() + '\n'); result.append(option.description() + "\n"); } return result.toString(); }
/** * generates the options string. * * @return the options string * @throws Exception in case the generation fails */ public String generate() throws Exception { StringBuffer result; OptionHandler handler; Enumeration<Option> enm; Option option; result = new StringBuffer(); handler = (OptionHandler) Utils.forName(null, getClassname(), new String[0]); enm = handler.listOptions(); while (enm.hasMoreElements()) { option = enm.nextElement(); result.append(option.synopsis() + '\n'); result.append(option.description() + "\n"); } return result.toString(); }
/** * returns all the options in a string * * @param generator the DataGenerator to return all the options for * @return the assembled option string */ protected static String makeOptionString(DataGenerator generator) { StringBuffer result; Enumeration<Option> enm; Option option; result = new StringBuffer(); result.append("\nData Generator options:\n\n"); enm = generator.listOptions(); while (enm.hasMoreElements()) { option = enm.nextElement(); // skip option if on blacklist if (isOnBlacklist(option.name())) { continue; } result.append(option.synopsis() + "\n" + option.description() + "\n"); } return result.toString(); }
/** * returns all the options in a string * * @param generator the DataGenerator to return all the options for * @return the assembled option string */ protected static String makeOptionString(DataGenerator generator) { StringBuffer result; Enumeration<Option> enm; Option option; result = new StringBuffer(); result.append("\nData Generator options:\n\n"); enm = generator.listOptions(); while (enm.hasMoreElements()) { option = enm.nextElement(); // skip option if on blacklist if (isOnBlacklist(option.name())) { continue; } result.append(option.synopsis() + "\n" + option.description() + "\n"); } return result.toString(); }
while (enm.hasMoreElements()) { Option option = enm.nextElement(); result.append(option.synopsis() + "\n" + option.description() + "\n");
/** * Test method for this class * * @param args the command line arguments */ public static void main(String [] args) { try { BVDecomposeSegCVSub bvd = new BVDecomposeSegCVSub(); try { bvd.setOptions(args); Utils.checkForRemainingOptions(args); } catch (Exception ex) { String result = ex.getMessage() + "\nBVDecompose Options:\n\n"; Enumeration<Option> enu = bvd.listOptions(); while (enu.hasMoreElements()) { Option option = (Option) enu.nextElement(); result += option.synopsis() + "\n" + option.description() + "\n"; } throw new Exception(result); } bvd.decompose(); System.out.println(bvd.toString()); } catch (Exception ex) { System.err.println(ex.getMessage()); } }
/** * Checks whether the scheme can take command line options. * * @return index 0 is true if the kernel can take options */ protected boolean[] canTakeOptions() { boolean[] result = new boolean[2]; print("options..."); if (m_Kernel instanceof OptionHandler) { println("yes"); if (m_Debug) { println("\n=== Full report ==="); Enumeration<Option> enu = ((OptionHandler) m_Kernel).listOptions(); while (enu.hasMoreElements()) { Option option = enu.nextElement(); print(option.synopsis() + "\n" + option.description() + "\n"); } println("\n"); } result[0] = true; } else { println("no"); result[0] = false; } return result; }
/** * Checks whether the scheme can take command line options. * * @return index 0 is true if the associator can take options */ protected boolean[] canTakeOptions() { boolean[] result = new boolean[2]; print("options..."); if (m_Associator instanceof OptionHandler) { println("yes"); if (m_Debug) { println("\n=== Full report ==="); Enumeration<Option> enu = ((OptionHandler) m_Associator).listOptions(); while (enu.hasMoreElements()) { Option option = enu.nextElement(); print(option.synopsis() + "\n" + option.description() + "\n"); } println("\n"); } result[0] = true; } else { println("no"); result[0] = false; } return result; }
/** * Checks whether the scheme can take command line options. * * @return index 0 is true if the estimator can take options */ protected boolean[] canTakeOptions() { boolean[] result = new boolean[2]; print("options..."); if (m_Estimator instanceof OptionHandler) { println("yes"); if (m_Debug) { println("\n=== Full report ==="); Enumeration<Option> enu = ((OptionHandler) m_Estimator).listOptions(); while (enu.hasMoreElements()) { Option option = enu.nextElement(); print(option.synopsis() + "\n" + option.description() + "\n"); } println("\n"); } result[0] = true; } else { println("no"); result[0] = false; } return result; }
/** * Checks whether the scheme can take command line options. * * @return index 0 is true if the classifier can take options */ protected boolean[] canTakeOptions() { boolean[] result = new boolean[2]; print("options..."); if (m_Classifier instanceof OptionHandler) { println("yes"); if (m_Debug) { println("\n=== Full report ==="); Enumeration<Option> enu = ((OptionHandler) m_Classifier).listOptions(); while (enu.hasMoreElements()) { Option option = enu.nextElement(); print(option.synopsis() + "\n" + option.description() + "\n"); } println("\n"); } result[0] = true; } else { println("no"); result[0] = false; } return result; }
/** * Checks whether the scheme can take command line options. * * @return index 0 is true if the clusterer can take options */ protected boolean[] canTakeOptions() { boolean[] result = new boolean[2]; print("options..."); if (m_Clusterer instanceof OptionHandler) { println("yes"); if (m_Debug) { println("\n=== Full report ==="); Enumeration<Option> enu = ((OptionHandler) m_Clusterer).listOptions(); while (enu.hasMoreElements()) { Option option = enu.nextElement(); print(option.synopsis() + "\n" + option.description() + "\n"); } println("\n"); } result[0] = true; } else { println("no"); result[0] = false; } return result; }