org.crosswire.common.options
Class GetOptions

java.lang.Object
  extended by org.crosswire.common.options.GetOptions

public class GetOptions
extends Object

GetOptions parses an argument list for requested arguments given by an OptionList.

This supports short and long options:
Short Options have the following characteristics.

Long Options have the following characteristics: Note:

Author:
DM Smith
See Also:
The GNU Lesser General Public License for details.

Field Summary
private  String[] args
           
private  List<String> nonOptionArgs
          The position in the array that is currently being studied.
private  String programName
           
private  OptionList programOptions
           
private  Map<Option,String> suppliedOptions
           
 
Constructor Summary
GetOptions(String programName, String[] args, OptionList programOptions)
           
 
Method Summary
 String getProgramName()
           
private  void parse()
           
 void setProgramName(String programName)
           
static void swap(Object[] array, int firstStart, int firstEnd, int secondEnd)
          Swap adjacent blocks in an array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

programName

private String programName

args

private String[] args

programOptions

private OptionList programOptions

nonOptionArgs

private List<String> nonOptionArgs
The position in the array that is currently being studied.


suppliedOptions

private Map<Option,String> suppliedOptions
Constructor Detail

GetOptions

public GetOptions(String programName,
                  String[] args,
                  OptionList programOptions)
Method Detail

getProgramName

public String getProgramName()
Returns:
the programName

setProgramName

public void setProgramName(String programName)
Parameters:
programName - the programName to set

parse

private void parse()

swap

public static void swap(Object[] array,
                        int firstStart,
                        int firstEnd,
                        int secondEnd)
Swap adjacent blocks in an array.

Parameters:
array - The array to modify in place
firstStart - the index of the start of the first block
firstEnd - the index of the end of the first block
secondEnd - the index of the end of the second block. Note: the start of the second block is firstEnd + 1

Copyright ยจ 2003-2015