public class StandardSettings extends Object
Copyright (c) 2013-2016 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
Modifier and Type | Field and Description |
---|---|
(package private) List<String> |
arguments
Non-switch command line arguments.
|
(package private) Map<String,String> |
switches
Map of collected switches.
|
Constructor and Description |
---|
StandardSettings(String[] commandLineArguments)
Construct StandardSettings from the command line arguments.
|
Modifier and Type | Method and Description |
---|---|
String |
firstArgument()
Reset the internal argument index and return the first non-switch command line argument.
|
String |
getSetting(String settingName,
String defaultValue) |
String |
getSwitch(String switchName,
String defaultValue)
Lookup and return a switch value.
|
String |
nextArgument()
Return the next non-switch command line argument and increment the internal argument index.
|
boolean |
testSwitch(String switchName)
Report if a switch is present.
|
public StandardSettings(String[] commandLineArguments)
commandLineArguments
- String[]; the command line argumentspublic boolean testSwitch(String switchName)
switchName
- String; name of the switch to report presence ofpublic String getSwitch(String switchName, String defaultValue)
switchName
- String; name of the switch to lookupdefaultValue
- String; default value to return if lookup failspublic String firstArgument()
public String nextArgument()
Copyright © 2014–2016 Delft University of Technology. All rights reserved.