Class ArrayExtract

  • All Implemented Interfaces:
    java.lang.Cloneable, Actor, Executable, FiringsRecordable, Initializable, TypedActor, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

    public class ArrayExtract
    extends Transformer
    Extract a subarray from an array. This actor reads an array from the input port and sends a subarray to the output port, possibly padded with zeros. The segment of the input array starting at sourcePosition with length extractLength is copied to the output array, starting at destinationPosition. The total length of the output array is outputArrayLength. Any of its entries that are not supplied by the input have value zero (of the same type as the entries in the input array). With the default values of the parameters, only the first element of the input array is copied to the output array, which has length one. The output type is the same as the input type.
    Since:
    Ptolemy II 1.0
    Version:
    $Id$
    Author:
    Edward A. Lee, Elaine Cheong
    Pt.AcceptedRating:
    Green (cxh)
    Pt.ProposedRating:
    Green (celaine)
    • Field Detail

      • sourcePosition

        public PortParameter sourcePosition
        The index into the input array at which to start copying. This is a non-negative integer that defaults to 0, and is required to be less than the length of the input array.
      • extractLength

        public PortParameter extractLength
        The length of the segment of the input array that is copied to the output. This is a non-negative integer that defaults to 1. The sum of it and the sourcePosition is required to be less than or equal to the length of the input array.
      • destinationPosition

        public PortParameter destinationPosition
        The index into the output array at which to start copying. This is a non-negative integer that defaults to 0, and is required to be less than the length of the output array.
      • outputArrayLength

        public PortParameter outputArrayLength
        The total length of the output array. This is a non-negative integer that defaults to 1. It is required to be at least destinationPosition plus extractLength.