com.nevelex.app.args
Interface ArgumentCommand


public interface ArgumentCommand

Base command-line argument command object.

This is the equivalent of the Command Interface of the Command Pattern.

Version:
1.0 03/22/2001: Initial Version.,
1.1 04/29/2003: Updated documenation.
Author:
Michel Dalal

Method Summary
 int consumeArgument(java.lang.String[] args, int offset)
          This method will attempt to consume the current command-line argument.
 

Method Detail

consumeArgument

public int consumeArgument(java.lang.String[] args,
                           int offset)
                    throws InvalidArgumentException
This method will attempt to consume the current command-line argument. The element in the args array at the offset will be the argument itself.

This is the equivalent of the execute method of the Command Interface of the Command Pattern.

Parameters:
args - the command line argument array.
offset - the offset in to the command line argument array where the argument exists.
Returns:
the offset for the next argument in the command.
Throws:
InvalidArgumentException - thrown if the argument was not supplied all of its required options.