Interface CommandLineParser

  • All Known Implementing Classes:
    ViewUserInterface

    public interface CommandLineParser
    A MIPAV command line parser reads the arguments provided to MIPAV at the command line. The parser is expected to keep an internal cursor to represent the location of the next argument to be parsed. The parseArguments function performs this functionality by receiving the array of arguments and the location of the cursor. When parseArguments returns args.length, this implies that all arguments have been processed.
    Author:
    senseneyj
    • Method Detail

      • parseArguments

        int parseArguments​(java.lang.String[] args,
                           int initArg)
        The parseArguments method parses command line arguments. An internal cursor can be used to track the next argument to be processed. The purpose of initArg is to tell this method which argument to start processing. This method returns the location of the next argument to be processed. If this method returns an integer equal to args.length, then it is implied that all arguments have been processed. Note that the cursor does not necessarily need to return a value greater than initArg.
        Parameters:
        args - command arguments
        initArgs - the location of the next command to be processed
        Returns:
        the location of the next command to be processed, if equal to args.length, then no further processing is necessary