Package nl.tno.imb.mc

Class StandardSettings

    • Constructor Detail

      • StandardSettings

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

      • 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