public void updateComScriptCommand(ComScriptCommand scriptCommand) throws BadComScriptException { // Create a new command line argument array ArrayList cmdLineArgs = new ArrayList(20); if (!ParamUtilities.isEmpty(rootName1)) { cmdLineArgs.add(rootName1); } if (!ParamUtilities.isEmpty(rootName2)) { cmdLineArgs.add(rootName2); } if (xDim != Integer.MIN_VALUE) { cmdLineArgs.add(ParamUtilities.valueOf(xDim)); } if (yDim != Integer.MIN_VALUE) { cmdLineArgs.add(ParamUtilities.valueOf(yDim)); } if (zDim != Integer.MIN_VALUE) { cmdLineArgs.add(ParamUtilities.valueOf(zDim)); } if (!ParamUtilities.isEmpty(xfIn)) { cmdLineArgs.add(xfIn); } if (!ParamUtilities.isEmpty(xfOut)) { cmdLineArgs.add(xfOut); } int nArgs = cmdLineArgs.size(); scriptCommand.setCommandLineArgs((String[]) cmdLineArgs.toArray(new String[nArgs])); }
public void parseComScriptCommand(ComScriptCommand scriptCommand) throws FortranInputSyntaxException, InvalidParameterException { String[] cmdLineArgs = scriptCommand.getCommandLineArgs(); if (cmdLineArgs.length < 5) { throw new InvalidParameterException("Matchshifts: Missing parameter."); } int i = 0; rootName1 = cmdLineArgs[i++]; rootName2 = cmdLineArgs[i++]; xDim = ParamUtilities.parseInt(cmdLineArgs[i++]); yDim = ParamUtilities.parseInt(cmdLineArgs[i++]); zDim = ParamUtilities.parseInt(cmdLineArgs[i++]); if (cmdLineArgs.length >= 6) { xfIn = cmdLineArgs[i++]; } if (cmdLineArgs.length >= 7) { xfOut = cmdLineArgs[i++]; } }