Class IntegerRange

  • All Implemented Interfaces:
    AdditionalInformationHandler, ArrayProvider, CleanUpHandler, Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, QuickInfoSupporter, ShallowCopySupporter<Actor>, SizeOfHandler, Stoppable, StoppableWithFeedback, VariablesInspectionHandler, VariableChangeListener, Actor, ArrayProvider, ErrorHandler, OutputProducer, Serializable, Comparable

    public class IntegerRange
    extends AbstractArrayProvider
    Outputs the integers defined by the range expression.

    Input/output:
    - generates:
       java.lang.Integer


    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -name <java.lang.String> (property: name)
        The name of the actor.
        default: IntegerRange
     
    -annotation <adams.core.base.BaseAnnotation> (property: annotations)
        The annotations to attach to this actor.
        default: 
     
    -skip <boolean> (property: skip)
        If set to true, transformation is skipped and the input token is just forwarded 
        as it is.
        default: false
     
    -stop-flow-on-error <boolean> (property: stopFlowOnError)
        If set to true, the flow gets stopped in case this actor encounters an error;
         useful for critical actors.
        default: false
     
    -silent <boolean> (property: silent)
        If enabled, then no errors are output in the console.
        default: false
     
    -output-array <boolean> (property: outputArray)
        Whether to output the integers one-by-one or as an array.
        default: false
     
    -range <adams.core.Range> (property: range)
        The range expression to use for generating the integers.
        default: first-last
        example: A range is a comma-separated list of single 1-based indices or sub-ranges of indices ('start-end'); 'inv(...)' inverts the range '...'; the following placeholders can be used as well: first, second, third, last_2, last_1, last
     
    -max <int> (property: max)
        The maximum number for the range.
        default: 100
        minimum: 1
     
    -zero-based <boolean> (property: zeroBased)
        If enabled, 0-based integers are output instead of 1-based ones ('first' 
        = 0 instead of 1).
        default: false
     
    Version:
    $Revision$
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Range

        protected Range m_Range
        the range.
      • m_Max

        protected int m_Max
        the maximum for the range.
      • m_ZeroBased

        protected boolean m_ZeroBased
        whether to output 0-based or 1-based integers.
    • Constructor Detail

      • IntegerRange

        public IntegerRange()
    • Method Detail

      • setRange

        public void setRange​(Range value)
        Sets the range to use.
        Parameters:
        value - the range
      • getRange

        public Range getRange()
        Returns the range to use.
        Returns:
        the range
      • rangeTipText

        public String rangeTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setMax

        public void setMax​(int value)
        Sets the maximum for the range.
        Parameters:
        value - the maximum
      • getMax

        public int getMax()
        Returns the maximum for the range.
        Returns:
        the maximum
      • maxTipText

        public String maxTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setZeroBased

        public void setZeroBased​(boolean value)
        Sets whether to output 1-based or 0-based integers.
        Parameters:
        value - true if 0-based
      • getZeroBased

        public boolean getZeroBased()
        Returns whether to output 1-based or 0-based integers.
        Returns:
        true if 0-based
      • zeroBasedTipText

        public String zeroBasedTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • doExecute

        protected String doExecute()
        Executes the flow item.
        Specified by:
        doExecute in class AbstractActor
        Returns:
        null if everything is fine, otherwise error message