|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ptc.wgmecad.ArgumentMap
This class is the repository for all command line options and for all data entered in the GUI. It acts as the data transfer mechanism to the code that actually performs the operations.
Field Summary | |
static String |
hookDebugSettingsFileName
|
static String |
hookSettingsFileName
|
private static ArgumentMap |
instance
|
(package private) static org.apache.log4j.Logger |
logger
|
private HashMap |
map
|
private HashMap |
mapPersistance
|
private static Boolean |
mustPersist
|
private File |
persistDebugHookFile
|
private File |
persistFile
|
private File |
persistHookFile
|
static String |
persistSeparator
|
static Object[] |
persistSortArray
|
static String |
settingsFileName
|
Constructor Summary | |
private |
ArgumentMap()
|
Method Summary | |
boolean |
defaultParameter(String name,
String defaultValue)
returns true if the parameter was already set. |
Argument |
getArgument(String name)
|
static ArgumentMap |
getInstance()
|
static int |
getIntValueFromArgMapKey(String resourceKey,
int defaultValue)
First default the argument map to have the value of defaultValue, then retrieve the value back from the map. |
int |
getNextAvailableArgumentNumber(String prefix)
|
boolean |
getParameterExists(String name)
|
boolean |
getParameterHasValue(String name)
|
String[] |
getParametersWithPrefix(String prefix)
returns an array of Strings of all the parameters which have the designated prefix. |
String |
getParameterValue(String name)
|
String |
getParameterValue(String name,
String defaultValue)
Return value for name parameter if it exists, defaultValue if it doesn't. |
File |
getPersistDebugHookFile(File _tempDir)
|
File |
getPersistFile(boolean forWrite)
|
File |
getPersistHookFile(File _tempDir)
|
boolean |
isParameterValueEqualTrue(String name)
Check on the state of a boolean parameter, the existance of which is uncertain. |
boolean |
isParameterValueEqualTrue(String name,
boolean defaultValue)
Check on the state of a boolean parameter, the existance of which is uncertain. |
boolean |
isPersistant(String name)
|
boolean |
loadPersistedArguments()
|
boolean |
loadPersistedArguments(BufferedReader file)
|
boolean |
loadPersistedArguments(File file)
|
void |
removeAllParameter(String _prefix)
|
int |
removeHolesFromNumberedArguments(String prefix)
This function consolidates the numbering of numbered args. |
boolean |
removeParameter(String name,
boolean savePersistance)
Remove a parameter from the map. |
boolean |
renameParameter(String oldName,
String newName)
Remove one parameter and rename it to another Returns true if a parameter is overwritten in the process. |
boolean |
savePersistedArguments(boolean isExit)
|
boolean |
savePersistedArguments(File file,
boolean isExit)
|
boolean |
savePersistedArguments(PrintStream file,
boolean isExit)
|
boolean |
savePersistedHookArguments_orig(PrintStream file)
|
boolean |
savePersistedHookArguments(boolean debug,
File _tempDir)
|
boolean |
savePersistedHookArguments(File file)
|
boolean |
savePersistedHookArguments(PrintStream file)
|
boolean |
setArgument(Argument arg,
boolean persist)
returns true if the parameter was previously set |
boolean |
setParameter(String name,
boolean persist)
|
boolean |
setParameter(String name,
String value,
boolean persist)
returns true if the parameter was previously set |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private HashMap map
private HashMap mapPersistance
private static Boolean mustPersist
public static final String persistSeparator
public static final String settingsFileName
public static final String hookSettingsFileName
public static final String hookDebugSettingsFileName
public static Object[] persistSortArray
static org.apache.log4j.Logger logger
private static ArgumentMap instance
private File persistDebugHookFile
private File persistHookFile
private File persistFile
Constructor Detail |
private ArgumentMap()
Method Detail |
public static ArgumentMap getInstance()
public int removeHolesFromNumberedArguments(String prefix)
public int getNextAvailableArgumentNumber(String prefix)
prefix
- - the arguments concidered will all start with this string
public boolean renameParameter(String oldName, String newName)
public boolean removeParameter(String name, boolean savePersistance)
public void removeAllParameter(String _prefix)
public File getPersistDebugHookFile(File _tempDir)
public File getPersistHookFile(File _tempDir)
public boolean savePersistedHookArguments(boolean debug, File _tempDir)
public boolean savePersistedHookArguments_orig(PrintStream file)
public boolean savePersistedHookArguments(PrintStream file)
public boolean savePersistedHookArguments(File file)
public File getPersistFile(boolean forWrite)
public boolean savePersistedArguments(boolean isExit)
public boolean savePersistedArguments(PrintStream file, boolean isExit)
public boolean savePersistedArguments(File file, boolean isExit)
public boolean loadPersistedArguments()
public boolean loadPersistedArguments(File file)
public boolean loadPersistedArguments(BufferedReader file) throws IOException
IOException
public boolean isPersistant(String name)
public boolean defaultParameter(String name, String defaultValue)
public boolean setParameter(String name, String value, boolean persist)
public boolean setArgument(Argument arg, boolean persist)
public boolean setParameter(String name, boolean persist)
public Argument getArgument(String name)
public boolean getParameterExists(String name)
public String getParameterValue(String name)
public String getParameterValue(String name, String defaultValue)
name
- defaultValue
-
public boolean getParameterHasValue(String name)
public String[] getParametersWithPrefix(String prefix)
public boolean isParameterValueEqualTrue(String name)
name
- - param name to check
public boolean isParameterValueEqualTrue(String name, boolean defaultValue)
name
- - param name to check
public static int getIntValueFromArgMapKey(String resourceKey, int defaultValue)
resourceKey
- - the key for the argument which specifies this number.defaultValue
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |