Class Options
java.lang.Object
ecmwf.common.text.Options
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Check date.boolean
Check long.boolean
Gets the.int
Gets the.long
Gets the.Gets the.getBoolean
(String option, Boolean defaultValue) Gets the boolean.getDuration
(String option, Duration defaultValue) Gets the duration.Gets the data as properties.void
Inject provided options into current options.void
Inject (e.g. options.inject("$test", "myFileName")).boolean
isEmpty()
Checks if is empty.boolean
Matches.boolean
Matches.replace
(StringBuilder target) Replace parameters into provided target.
-
Constructor Details
-
Options
public Options()Instantiates a new Options with no parameters (empty). -
Options
Instantiates a new Options. Parse options in the form: filesize=">1234";fileage>=24h,dateformat=yyyyMMdd;datedelta="-1d". Default delimiters are ";", "," and new line.- Parameters:
options
- the options
-
Options
Instantiates a new Options. Parse options in the form: filesize=">1234";fileage>=24h,dateformat=yyyyMMdd;datedelta="-1d". Default delimiters are ";", "," and new line if specified delimiters is empty or null.- Parameters:
options
- the optionsdelimiters
- the delimiters
-
Options
-
-
Method Details
-
isEmpty
public boolean isEmpty()Checks if is empty.- Returns:
- true, if is empty
-
inject
-
inject
Inject provided options into current options. We have to order the list of keys by length otherwise a "time" and "timestep" key might clash if not taken in the right order (e.g. if $ab=12 and $abcd=15 then the string 'c=$abcd,$ab' would be translated into 'c=12cd,12' instead of 'c=15,12).- Parameters:
options
- the options
-
replace
Replace parameters into provided target. We have to order the list of keys by length otherwise a "time" and "timestep" key might clash if not taken in the right order (e.g. if $ab=12 and $abcd=15 then the string 'c=$abcd,$ab' would be translated into 'c=12cd,12' instead of 'c=15,12).- Parameters:
target
- the target- Returns:
- the string builder
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
get
-
get
Gets the.- Parameters:
option
- the optiondefaultValue
- the default value- Returns:
- the int
-
get
Gets the.- Parameters:
option
- the optiondefaultValue
- the default value- Returns:
- the long
-
get
Gets the.- Parameters:
option
- the optiondefaultValue
- the default value- Returns:
- true, if successful
-
getDuration
-
getBoolean
-
getProperties
-
matches
-
matches
-
checkLong
Check long.- Parameters:
option
- the optioncurrentLong
- the current long- Returns:
- true, if successful
-
checkDate
Check date.- Parameters:
option
- the optioncurrentDate
- the current date- Returns:
- true, if successful
-