Package nl.tno.imb.mc
Class StandardSettings
- java.lang.Object
-
- nl.tno.imb.mc.StandardSettings
-
public class StandardSettings extends java.lang.ObjectCopyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.- Version:
- $Revision$, $LastChangedDate$, by $Author$, initial version Oct 17, 2016
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
-
Constructor Summary
Constructors Constructor Description StandardSettings(java.lang.String[] commandLineArguments)Construct StandardSettings from the command line arguments.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringfirstArgument()Reset the internal argument index and return the first non-switch command line argument.java.lang.StringgetSetting(java.lang.String settingName, java.lang.String defaultValue)java.lang.StringgetSwitch(java.lang.String switchName, java.lang.String defaultValue)Lookup and return a switch value.java.lang.StringnextArgument()Return the next non-switch command line argument and increment the internal argument index.booleantestSwitch(java.lang.String switchName)Report if a switch is present.
-
-
-
Method Detail
-
testSwitch
public boolean testSwitch(java.lang.String switchName)
Report if a switch is present.- Parameters:
switchName- String; name of the switch to report presence of- Returns:
- boolean; true if the switch is present; false if the switch is not present
-
getSwitch
public java.lang.String getSwitch(java.lang.String switchName, java.lang.String defaultValue)Lookup and return a switch value.- Parameters:
switchName- String; name of the switch to lookupdefaultValue- String; default value to return if lookup fails- Returns:
- String; the value of the switch, or defaultValue if the switch is not defined
-
firstArgument
public java.lang.String firstArgument()
Reset the internal argument index and return the first non-switch command line argument.- Returns:
- String
-
nextArgument
public java.lang.String nextArgument()
Return the next non-switch command line argument and increment the internal argument index.- Returns:
- String; the next non-switch command line argument, or "" if there are no more non-switch command line arguments
-
getSetting
public java.lang.String getSetting(java.lang.String settingName, java.lang.String defaultValue)
-
-