Class IntParameter

  • All Implemented Interfaces:
    Parameter<java.lang.Integer>

    public class IntParameter
    extends NumberParameter<IntParameter,​java.lang.Integer>
    Parameter class for a parameter specifying an integer value.
    Since:
    0.1
    Author:
    Steffi Wanka, Erich Schubert
    • Constructor Detail

      • IntParameter

        public IntParameter​(OptionID optionID,
                            int defaultValue)
        Constructs an integer parameter with the given optionID.
        Parameters:
        optionID - optionID the unique id of the option
        defaultValue - the default value
      • IntParameter

        public IntParameter​(OptionID optionID)
        Constructs an integer parameter with the given optionID.
        Parameters:
        optionID - optionID the unique id of the option
    • Method Detail

      • getValueAsString

        public java.lang.String getValueAsString()
        Description copied from interface: Parameter
        Get the value as string. May return null
        Returns:
        Value as string
      • getSyntax

        public java.lang.String getSyntax()
        Returns a string representation of the parameter's type.
        Returns:
        "<int>"
      • intValue

        public int intValue()
        Get the parameter value as integer
        Returns:
        Parameter value
      • grab

        public boolean grab​(Parameterization config,
                            java.util.function.IntConsumer consumer)
        Get the parameter.
        Parameters:
        config - Parameterization
        consumer - Output consumer
        Returns:
        true if valid