Package nl.tno.imb.mc

Class StandardSettings


  • public class StandardSettings
    extends java.lang.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 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.String firstArgument()
      Reset the internal argument index and return the first non-switch command line argument.
      java.lang.String getSetting​(java.lang.String settingName, java.lang.String defaultValue)  
      java.lang.String getSwitch​(java.lang.String switchName, java.lang.String defaultValue)
      Lookup and return a switch value.
      java.lang.String nextArgument()
      Return the next non-switch command line argument and increment the internal argument index.
      boolean testSwitch​(java.lang.String switchName)
      Report if a switch is present.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StandardSettings

        public StandardSettings​(java.lang.String[] commandLineArguments)
        Construct StandardSettings from the command line arguments.
        Parameters:
        commandLineArguments - String[]; the command line arguments
    • 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 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 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)