Class ClampedParam<T extends Comparable<T>>

java.lang.Object
org.rwtodd.args.ClampedParam<T>
All Implemented Interfaces:
OneArgParam<T>, Param

public class ClampedParam<T extends Comparable<T>> extends Object implements OneArgParam<T>
  • Constructor Details

    • ClampedParam

      public ClampedParam(OneArgParam<T> delegate, T min, T max)
  • Method Details

    • process

      public void process(String param, String argument) throws ArgParserException
      Process an parameter with its argument.
      Specified by:
      process in interface OneArgParam<T extends Comparable<T>>
      Parameters:
      param - the name of the parameter, as it was found in the command-line.
      argument - the given argument to the parameter.
      Throws:
      ArgParserException - if there is a problem parsing the argument.
    • getValue

      public T getValue()
      gets the current value of the parameter
      Specified by:
      getValue in interface OneArgParam<T extends Comparable<T>>
    • addToMap

      public void addToMap(Map<String,Param> map)
      Add the parameter's names to a Map<String,Param>.
      Specified by:
      addToMap in interface Param
      Parameters:
      map - the Map to which our names should be added.
    • addHelp

      public void addHelp(PrintStream ps)
      adds help for this parameter to the given stream.
      Specified by:
      addHelp in interface Param
      Parameters:
      ps - the stream to use