Class ArraySubset

  • 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 ArraySubset
    extends AbstractTransformer
    Generates a subset of the array, using the specified array elements.

    Input/output:
    - accepts:
       adams.flow.core.Unknown[]
    - generates:
       adams.flow.core.Unknown[]


    Valid options are:

    -D <int> (property: debugLevel)
        The greater the number the more additional info the scheme may output to 
        the console (0 = off).
        default: 0
        minimum: 0
     
    -name <java.lang.String> (property: name)
        The name of the actor.
        default: ArraySubset
     
    -annotation <adams.core.base.BaseText> (property: annotations)
        The annotations to attach to this actor.
        default: 
     
    -skip (property: skip)
        If set to true, transformation is skipped and the input token is just forwarded 
        as it is.
     
    -stop-flow-on-error (property: stopFlowOnError)
        If set to true, the flow gets stopped in case this actor encounters an error;
         useful for critical actors.
     
    -elements <adams.core.Range> (property: elements)
        The range of elements to pick from the array; 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
        default: first-last
     
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Elements

        protected Range m_Elements
        the elements of the subset to extract.
    • Constructor Detail

      • ArraySubset

        public ArraySubset()
    • Method Detail

      • setElements

        public void setElements​(Range value)
        Sets the array elements to pick.
        Parameters:
        value - the range of elements
      • getElements

        public Range getElements()
        Returns the array elements to pick.
        Returns:
        the range of elements
      • elementsTipText

        public String elementsTipText()
        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:
        adams.flow.core.Unknown[].class
      • generates

        public Class[] generates()
        Returns the class of objects that it generates.
        Returns:
        adams.flow.core.Unknown[].class
      • doExecute

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