Documentation of 'smile.demo.util.ParameterParser' Java class
ParameterParser
smile.demo.util

Class ParameterParser



  • public class ParameterParser
    extends java.lang.Object
    A simple utility to parse command line parameters.
    • Constructor Detail

      • ParameterParser

        public ParameterParser(java.lang.String usage)
        Constructor.
        Parameters:
        usage - the usage information that will be display if -h, -help or invalid parameter presents.
    • Method Detail

      • addParameter

        public void addParameter(java.lang.String name,
                                 ParameterParser.ParameterType type)
        Add a (optional) parameter.
        Parameters:
        name - the name of parameter.
        type - the type of parameter.
      • addParameter

        public void addParameter(java.lang.String name,
                                 ParameterParser.ParameterType type,
                                 boolean mandatory)
        Add a parameter.
        Parameters:
        name - the name of parameter.
        type - the type of parameter.
        mandatory - true if the parameter is mandatory.
      • addParameter

        public void addParameter(java.lang.String name,
                                 ParameterParser.ParameterType type,
                                 java.lang.String defaultValue)
        Add a (optional) parameter.
        Parameters:
        name - the name of parameter.
        type - the type of parameter.
        defaultValue - the default value of parameter.
      • get

        public java.lang.String get(java.lang.String name)
        Returns the value of a given parameter. Null if the parameter does not present.
      • parse

        public java.util.List<java.lang.String> parse(java.lang.String[] args)
        Parse the arguments.
        Parameters:
        args - arguments
        Returns:
        a list of strings which are not parameters, e.g. a list of file name.

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.