org.hackystat.telemetry.analyzer.reducer.util
Class ReducerOptionUtility

java.lang.Object
  extended by org.hackystat.telemetry.analyzer.reducer.util.ReducerOptionUtility

public class ReducerOptionUtility
extends java.lang.Object

Provides utility functions for handling reducer options.

Author:
(Cedric) Qin Zhang

Constructor Summary
ReducerOptionUtility()
           
 
Method Summary
static boolean parseBooleanOption(int optionIndex, java.lang.String optionString)
          Parses boolean reduction option.
static int parseModeOption(int optionIndex, java.lang.String[] modes, java.lang.String modeString)
          Parses mode option.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReducerOptionUtility

public ReducerOptionUtility()
Method Detail

parseBooleanOption

public static boolean parseBooleanOption(int optionIndex,
                                         java.lang.String optionString)
                                  throws TelemetryReducerException
Parses boolean reduction option.

Parameters:
optionIndex - The 0-based option position.
optionString - The option string to be parsed.
Returns:
True or false.
Throws:
TelemetryReducerException - If the option string does not represent a boolean value.

parseModeOption

public static int parseModeOption(int optionIndex,
                                  java.lang.String[] modes,
                                  java.lang.String modeString)
                           throws TelemetryReducerException
Parses mode option.

Parameters:
optionIndex - The 0-based option position.
modes - An array of acceptable strings.
modeString - The option string to be parsed.
Returns:
The index into modes where modes[index] == modeString (case insensitive).
Throws:
TelemetryReducerException - If no match can be found.