Package org.sikuli.script
Class Options
java.lang.Object
org.sikuli.script.Options
public class Options extends Object
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description voiddumpOptions()all options and their values written to sysout as key = valueStringgetOption(String pName){link getOption}StringgetOption(String pName, String sDefault)if no option file is found, the option is taken as not existing
side-effect: if no options file is there, an options store will be created in memory
in this case and when the option is absent or empty, the given default will be stored
you might later save the options store to a file with saveOptions()
the default value is either the empty string, number 0 or falsedoublegetOptionDouble(String pName){link getOption}doublegetOptionDouble(String pName, double nDefault){link getOption}floatgetOptionFloat(String pName){link getOption}floatgetOptionFloat(String pName, float nDefault){link getOption}intgetOptionInteger(String pName){link getOption}intgetOptionInteger(String pName, Integer nDefault){link getOption}Map<String,String>getOptions()all options and their valuesStringgetOptionsFile()static StringgetOptionsFileDefault()booleanhasOptions()check whether options are definedstatic Optionsinit(RunTime pRunTime)booleanisOption(String pName){link getOption}booleanisOption(String pName, boolean bDefault){link getOption}booleansaveOptions()save a properties store to a file (prop: this.comingfrom = abs.booleansaveOpts(String fpOptions)save a properties store to the given filevoidsetOption(String pName, String sValue){link getOption}voidsetOptionBool(String pName, boolean bValue){link getOption}voidsetOptionDouble(String pName, double nValue){link getOption}voidsetOptionFloat(String pName, float nValue){link getOption}voidsetOptionInteger(String pName, int nValue){link getOption}
-
Constructor Details
-
Method Details
-
getOptionsFileDefault
-
getOptionsFile
-
init
-
saveOptions
public boolean saveOptions()save a properties store to a file (prop: this.comingfrom = abs. filepath)- Returns:
- success
-
saveOpts
save a properties store to the given file- Parameters:
fpOptions- path to a file- Returns:
- success
-
getOption
if no option file is found, the option is taken as not existing
side-effect: if no options file is there, an options store will be created in memory
in this case and when the option is absent or empty, the given default will be stored
you might later save the options store to a file with saveOptions()
the default value is either the empty string, number 0 or false- Parameters:
pName- the option key (case-sensitive)sDefault- the default to be returned if option absent or empty- Returns:
- the associated value, the default value if absent or empty
-
getOption
{link getOption}- Parameters:
pName- the option key (case-sensitive)- Returns:
- the associated value, empty string if absent
-
setOption
{link getOption}- Parameters:
pName- the option key (case-sensitive)sValue- the value to be set
-
getOptionInteger
{link getOption}- Parameters:
pName- the option key (case-sensitive)nDefault- the default to be returned if option absent, empty or not convertible- Returns:
- the converted integer number, default if absent, empty or not possible
-
getOptionInteger
{link getOption}- Parameters:
pName- the option key (case-sensitive)- Returns:
- the converted integer number, 0 if absent or not possible
-
setOptionInteger
{link getOption}- Parameters:
pName- the option key (case-sensitive)nValue- the value to be set
-
getOptionFloat
{link getOption}- Parameters:
pName- the option key (case-sensitive)- Returns:
- the converted float number, default if absent or not possible
-
getOptionFloat
{link getOption}- Parameters:
pName- the option key (case-sensitive)- Returns:
- the converted float number, 0 if absent or not possible
-
setOptionFloat
{link getOption}- Parameters:
pName- the option key (case-sensitive)nValue- the value to be set
-
getOptionDouble
{link getOption}- Parameters:
pName- the option key (case-sensitive)- Returns:
- the converted float number, default if absent or not possible
-
getOptionDouble
{link getOption}- Parameters:
pName- the option key (case-sensitive)- Returns:
- the converted double number, 0 if absent or not possible
-
setOptionDouble
{link getOption}- Parameters:
pName- the option key (case-sensitive)nValue- the value to be set
-
isOption
{link getOption}- Parameters:
pName- the option key (case-sensitive)bDefault- the default to be returned if option absent or empty- Returns:
- true if option has yes or no, false for no or false (not case-sensitive)
-
isOption
{link getOption}- Parameters:
pName- the option key (case-sensitive)- Returns:
- true only if option exists and has yes or true (not case-sensitive), in all other cases false
-
setOptionBool
{link getOption}- Parameters:
pName- the option key (case-sensitive)bValue- the value to be set
-
hasOptions
public boolean hasOptions()check whether options are defined- Returns:
- true if at lest one option defined else false
-
getOptions
all options and their values- Returns:
- a map of key-value pairs containing the found options, empty if no options file found
-
dumpOptions
public void dumpOptions()all options and their values written to sysout as key = value
-