Package nl.tno.imb.mc
Class StandardSettings
java.lang.Object
nl.tno.imb.mc.StandardSettings
public class StandardSettings extends Object
Copyright (c) 2013-2019 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(String[] commandLineArguments)Construct StandardSettings from the command line arguments. -
Method Summary
Modifier and Type Method Description StringfirstArgument()Reset the internal argument index and return the first non-switch command line argument.StringgetSetting(String settingName, String defaultValue)StringgetSwitch(String switchName, String defaultValue)Lookup and return a switch value.StringnextArgument()Return the next non-switch command line argument and increment the internal argument index.booleantestSwitch(String switchName)Report if a switch is present.
-
Constructor Details
-
StandardSettings
Construct StandardSettings from the command line arguments.- Parameters:
commandLineArguments- String[]; the command line arguments
-
-
Method Details
-
testSwitch
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
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
Reset the internal argument index and return the first non-switch command line argument.- Returns:
- 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
-