Package nl.tno.imb.mc

Class StandardSettings

java.lang.Object
nl.tno.imb.mc.StandardSettings

public class StandardSettings
extends Object

Copyright (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 Details

    • StandardSettings

      public StandardSettings​(String[] commandLineArguments)
      Construct StandardSettings from the command line arguments.
      Parameters:
      commandLineArguments - String[]; the command line arguments
  • Method Details

    • testSwitch

      public boolean testSwitch​(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 String getSwitch​(String switchName, String defaultValue)
      Lookup and return a switch value.
      Parameters:
      switchName - String; name of the switch to lookup
      defaultValue - 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 String firstArgument()
      Reset the internal argument index and return the first non-switch command line argument.
      Returns:
      String
    • nextArgument

      public 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 String getSetting​(String settingName, String defaultValue)