Beispiel #1
0
 public String formatOpts(Collection pLongNames) {
   StringBuffer result = new StringBuffer();
   Map longnametoshortnamemap = CollectionUtils.inverseMap(mShortNameToLongNameMap);
   Iterator longnames = pLongNames.iterator();
   while (longnames.hasNext()) {
     String longname = (String) longnames.next();
     result.append("  -" + longname);
     String shortname = (String) longnametoshortnamemap.get(longname);
     if (shortname != null) {
       result.append(" (-" + shortname + ")");
     }
     String possibleValsString = "";
     if (mPossibleValues.keySet().contains(longname)) {
       possibleValsString = " " + mPossibleValues.get(longname);
     }
     result.append(possibleValsString);
     String defaultVal = (String) mDefaultValues.get(longname);
     if (defaultVal != null) {
       result.append(", default=" + defaultVal);
     }
     if (longnames.hasNext()) {
       result.append("\n");
     }
   }
   return result.toString();
 }
Beispiel #2
0
 public Set getOptions(String pKey) {
   return mPossibleValues.get(pKey);
 }