001/* A simple sink actor that consumes and discards input tokens of type GENERAL. 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.BaseType; 032import ptolemy.kernel.CompositeEntity; 033import ptolemy.kernel.util.IllegalActionException; 034import ptolemy.kernel.util.NameDuplicationException; 035 036/////////////////////////////////////////////////////////////////// 037//// DiscardDoubles 038 039/** 040 A simple sink actor that consumes and discards input tokens of type General. 041 042 <p>The primary use of this actor is that it is used when the MoML 043 filter replaces actors that take a General input, like ImageDisplay. 044 A Discard actor is not sufficient because the type of the input is 045 not set. If backward type propagation is in use, a Discard actor that 046 has type General is needed to replace the ImageDIsplay that have inputs of 047 type General.</p> 048 049 @see ptolemy.actor.lib.Discard 050 @see ptolemy.moml.filter.DiscardDoubles 051 @author Christopher Brooks 052 @version $Id$ 053 @since Ptolemy II 11.0 054 @Pt.ProposedRating Yellow (cxh) 055 @Pt.AcceptedRating Yellow (cxh) 056 */ 057public class DiscardGenerals extends Discard { 058 059 /** Construct an actor with an input multiport with type general. 060 * @param container The container. 061 * @param name The name of this actor. 062 * @exception IllegalActionException If the actor cannot be contained 063 * by the proposed container. 064 * @exception NameDuplicationException If the container already has an 065 * actor with this name. 066 */ 067 public DiscardGenerals(CompositeEntity container, String name) 068 throws NameDuplicationException, IllegalActionException { 069 super(container, name); 070 input.setTypeEquals(BaseType.GENERAL); 071 } 072}