Class Min

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

    public class Min
    extends AbstractTransformer
    Returns the minimum value from a double/int array or the index of the minimum value.

    Input/output:
    - accepts:
       java.lang.Integer[]
       java.lang.Double[]
       int[]
       double[]
    - generates:
       java.lang.Integer
       java.lang.Double


    -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: Min
     
    -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 execution at this level gets stopped in case this 
        actor encounters an error; the error gets propagated; useful for critical 
        actors.
        default: false
     
    -silent <boolean> (property: silent)
        If enabled, then no errors are output in the console; Note: the enclosing 
        actor handler must have this enabled as well.
        default: false
     
    -index <boolean> (property: returnIndex)
        If set to true, then the index of the minimum is returned instead of the 
        value.
        default: false
     
    -use-one-based-index <boolean> (property: useOneBasedIndex)
        If enabled, 1-based indices are returned instead of 0-based ones.
        default: false
     
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_ReturnIndex

        protected boolean m_ReturnIndex
        whether to return the index instead of the value.
      • m_UseOneBasedIndex

        protected boolean m_UseOneBasedIndex
        whether to return 1-based indices.
    • Constructor Detail

      • Min

        public Min()
    • Method Detail

      • setReturnIndex

        public void setReturnIndex​(boolean value)
        Sets whether to return the value or the index.
        Parameters:
        value - true if to return the index, false to return value
      • getReturnIndex

        public boolean getReturnIndex()
        Returns whether to return the value or the index.
        Returns:
        true the index is returned, false if the value is returned
      • returnIndexTipText

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

        public void setUseOneBasedIndex​(boolean value)
        Sets whether to return 1-based indices or 0-based ones.
        Parameters:
        value - true if to return 1-based indices
      • getUseOneBasedIndex

        public boolean getUseOneBasedIndex()
        Returns whether to return 1-based indices or 0-based ones.
        Returns:
        true if to return 1-based indices
      • useOneBasedIndexTipText

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

        public Class[] accepts()
        Returns the class that the consumer accepts.
        Returns:
        java.lang.Integer[].class, java.lang.Double[].class, int[].class, double[].class
      • generates

        public Class[] generates()
        Returns the class of objects that it generates.
        Returns:
        java.lang.Integer.class, java.lang.Double.class
      • doExecute

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