org.apache.hadoop.fs.shell
Class CommandFormat

java.lang.Object
  extended by org.apache.hadoop.fs.shell.CommandFormat

public class CommandFormat
extends Object

Parse the args of a command and check the format of args.


Constructor Summary
CommandFormat(String n, int min, int max, String... possibleOpt)
          constructor
 
Method Summary
 boolean getOpt(String option)
          Return if the option is set or not
 List<String> parse(String[] args, int pos)
          Parse parameters starting from the given position
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandFormat

public CommandFormat(String n,
                     int min,
                     int max,
                     String... possibleOpt)
constructor

Method Detail

parse

public List<String> parse(String[] args,
                          int pos)
Parse parameters starting from the given position

Parameters:
args - an array of input arguments
pos - the position at which starts to parse
Returns:
a list of parameters

getOpt

public boolean getOpt(String option)
Return if the option is set or not

Parameters:
option - String representation of an option
Returns:
true is the option is set; false otherwise


Copyright © 2009 The Apache Software Foundation