+
+ public abstract List<OptionI> getOptions();
+ public List<OptionI> getBaseOptions()
+ {
+ ArrayList<OptionI> opts = new ArrayList<OptionI>();
+ opts.add(new IntegerParameter("min","Minimum number of data of this type",true,1,min,0,-1));
+ opts.add(new IntegerParameter("max","Maximum number of data of this type",false,0,max,0,-1));
+ return opts;
+ }
+ /**
+ * make a copy of this InputType
+ * @return
+ * may not be needed
+ public abstract InputType copy();
+ */
+
+ /**
+ * parse a set of configuration options
+ * @param currentSettings - modified settings originally from getOptions
+ * @throws InvalidArgumentException thrown if currentSettings contains invalid options for this type.
+ */
+ public void configureFromArgumentI(List<ArgumentI> currentSettings) throws InvalidArgumentException
+ {
+ ArrayList<String> urltoks = new ArrayList<String>();
+ String rg;
+ for (ArgumentI arg: currentSettings)
+ {
+ if (arg instanceof ParameterI)
+ {
+ rg=arg.getName()+"='"+arg.getValue()+"'";
+ } else {
+ // TODO: revise architecture - this is counter intuitive - options with different values to their names are actually parameters
+ rg=(arg.getValue().length()>0) ? (arg.getValue().equals(arg.getName()) ? arg.getName():arg.getName()+"='"+arg.getValue()+"'")
+ : arg.getName();
+ }
+ if (rg.length()>0) {
+ urltoks.add(rg);
+ }
+ }
+ StringBuffer warnings;
+ if (!configureFromURLtokenString(urltoks, warnings=new StringBuffer()))
+ {
+ throw new InvalidArgumentException(warnings.toString());
+ }
+ }
+ protected OptionI createMolTypeOption(String name, String descr,
+ boolean req, molType curType, molType defType)
+ {
+ return new Option(name,descr, req, defType==null ? "" : defType.toString(), curType==null ? "" : curType.toString(),molType.toStringValues(),
+ null);
+ }