001/* A simple sink actor that consumes and discards double input tokens. 002 003 Copyright (c) 2015-2018 The Regents of the University of California. 004 All rights reserved. 005 Permission is hereby granted, without written agreement and without 006 license or royalty fees, to use, copy, modify, and distribute this 007 software and its documentation for any purpose, provided that the above 008 copyright notice and the following two paragraphs appear in all copies 009 of this software. 010 011 IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY 012 FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 013 ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF 014 THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF 015 SUCH DAMAGE. 016 017 THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, 018 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 019 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE 020 PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF 021 CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, 022 ENHANCEMENTS, OR MODIFICATIONS. 023 024 PT_COPYRIGHT_VERSION_2 025 COPYRIGHTENDKEY 026 027 */ 028package ptolemy.moml.filter; 029 030import ptolemy.actor.lib.Discard; 031import ptolemy.data.type.ArrayType; 032import ptolemy.data.type.BaseType; 033import ptolemy.kernel.CompositeEntity; 034import ptolemy.kernel.util.IllegalActionException; 035import ptolemy.kernel.util.NameDuplicationException; 036 037/////////////////////////////////////////////////////////////////// 038//// DiscardDoublesArrays 039 040/** 041 A simple sink actor that consumes and discards arrays of double input 042 tokens. 043 044 <p>The primary use of this actor is that it is used when the MoML 045 filter replaces plotters. A Discard actor is not sufficient because 046 the type of the input is general. If backward type propagation is in 047 use, a Discard actor that accepts arrays of double is needed to 048 replace the plotters that have inputs of type double array.</p> 049 050 @see ptolemy.actor.lib.Discard 051 @see ptolemy.moml.filter.DiscardDoubles 052 @author Christopher Brooks 053 @version $Id$ 054 @since Ptolemy II 11.0 055 @Pt.ProposedRating Yellow (cxh) 056 @Pt.AcceptedRating Yellow (cxh) 057 */ 058public class DiscardDoublesArray extends Discard { 059 060 /** Construct an actor with an input multiport with type double. 061 * @param container The container. 062 * @param name The name of this actor. 063 * @exception IllegalActionException If the actor cannot be contained 064 * by the proposed container. 065 * @exception NameDuplicationException If the container already has an 066 * actor with this name. 067 */ 068 public DiscardDoublesArray(CompositeEntity container, String name) 069 throws NameDuplicationException, IllegalActionException { 070 super(container, name); 071 input.setTypeEquals(new ArrayType(BaseType.DOUBLE)); 072 } 073}