Class MyArgs

java.lang.Object
org.cip4.jdflib.util.MyArgs

public class MyArgs extends Object
  • Constructor Details

    • MyArgs

      @Deprecated public MyArgs(String[] argv, String switchParameterString, String argumentParameterString)
      Deprecated.
      Parameters:
      argv -
      switchParameterString -
      argumentParameterString -
    • MyArgs

      public MyArgs(String[] argv, String switchParameterString, String argumentParameterString, String requiredParameterString)
      Parameters:
      argv -
      switchParameterString -
      argumentParameterString -
      requiredParameterString -
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      See Also:
    • missingArgs

      public String missingArgs()
      Parameters:
      c -
      Returns:
    • parameter

      public String parameter(String c)
      Parameters:
      c -
      Returns:
    • parameter

      public String parameter(char c)
      Parameters:
      c -
      Returns:
    • parameterString

      public String parameterString(String s)
      Parameters:
      s -
      Returns:
    • parameterString

      public String parameterString(char c)
      Parameters:
      c -
      Returns:
    • nargs

      public int nargs()
      Returns:
    • argument

      public String argument(int m)
      Parameters:
      m -
      Returns:
    • argumentString

      public String argumentString(int m)
      Parameters:
      m -
      Returns:
      default: ArgumentString(0)
    • intParameter

      public int intParameter(char c, int defaultValue, int radix)
      convert character to interger
      Parameters:
      c -
      defaultValue -
      radix -
      Returns:
      default: IntParameter(c + JDFConstants.EMPTYSTRING, 0, 10)
    • intParameter

      public int intParameter(String s, int defaultValue, int radix)
      Parameters:
      s -
      defaultValue -
      radix -
      Returns:
      default: IntParameter(s + JDFConstants.EMPTYSTRING, 0, 10)
    • floatParameter

      public double floatParameter(char c, double defaultValue)
      convert character to double
      Parameters:
      c -
      defaultValue -
      Returns:
      default: FloatParameter(JDFConstants.EMPTYSTRING + c, 0)
    • floatParameter

      public double floatParameter(String s, double defaultValue)
      Parameters:
      s -
      defaultValue -
      Returns:
      default: FloatParameter(JDFConstants.EMPTYSTRING + s, 0)
    • boolParameter

      public boolean boolParameter(char c)
      convert character to boolean
      Parameters:
      c -
      Returns:
      default: BoolParameter(c + JDFConstants.EMPTYSTRING, false)
    • boolParameter

      @Deprecated public boolean boolParameter(char c, boolean defaultValue)
      Deprecated.
      defaultValue==true is kind of stupid...
      convert character to boolean
      Parameters:
      c -
      defaultValue -
      Returns:
      default: BoolParameter(c + JDFConstants.EMPTYSTRING, false)
    • setFlag

      public void setFlag(char c, boolean val)
      set or remove a boolean flag
      Parameters:
      c - the flag key
      val - if true, set else remove
    • setParam

      public void setParam(char c, String val)
      set or remove a boolean flag
      Parameters:
      c - the flag key
      val - the parameter value, if null remove
    • boolParameter

      @Deprecated public boolean boolParameter(String s, boolean defaultValue)
      Deprecated.
      defaultValue==true is kind of stupid...
      Parameters:
      s -
      defaultValue -
      Returns:
      default: BoolParameter(s + JDFConstants.EMPTYSTRING, false)
    • boolParameter

      public boolean boolParameter(String s)
      Parameters:
      s -
      Returns:
    • usage

      public String usage(String paramString)
      Parameters:
      paramString -
      Returns:
      default: null
    • hasParameter

      public boolean hasParameter(char c)
      return true if either a flag or parameter for c is set
      Parameters:
      c - the char to test for
      Returns: