001/* DummyReferenceToken is a token encapsulating a reference to a shared 002 data object. It is used for testing the OptimizingSDFDirector. 003 004 Copyright (c) 1997-2014 The Regents of the University of California. 005 All rights reserved. 006 Permission is hereby granted, without written agreement and without 007 license or royalty fees, to use, copy, modify, and distribute this 008 software and its documentation for any purpose, provided that the above 009 copyright notice and the following two paragraphs appear in all copies 010 of this software. 011 012 IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY 013 FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 014 ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF 015 THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF 016 SUCH DAMAGE. 017 018 THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, 019 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 020 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE 021 PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF 022 CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, 023 ENHANCEMENTS, OR MODIFICATIONS. 024 PT_COPYRIGHT_VERSION_2 025 COPYRIGHTENDKEY 026 027 */ 028 029/** 030 * 031 */ 032package ptolemy.domains.sdf.optimize.lib; 033 034import ptolemy.data.Token; 035 036/** 037<h1>Class comments</h1> 038DummyReferenceToken is a token encapsulating a reference to a shared 039data object. It is used for testing the OptimizingSDFDirector. 040<p> 041See {@link ptolemy.domains.sdf.optimize.OptimizingSDFDirector} and 042{@link ptolemy.domains.sdf.optimize.lib.DummyFrame} for more information. 043</p> 044@see ptolemy.domains.sdf.optimize.OptimizingSDFDirector 045@see ptolemy.domains.sdf.optimize.lib.DummyFrame 046 047@author Marc Geilen 048@version $Id$ 049@since Ptolemy II 10.0 050@Pt.ProposedRating Red (mgeilen) 051@Pt.AcceptedRating Red () 052 */ 053public class DummyReferenceToken extends Token { 054 055 /** 056 * Create an instance of a reference token. 057 * @param r the object the token shall refer to 058 */ 059 public DummyReferenceToken(Object r) { 060 _ref = r; 061 } 062 063 /** 064 * Gets the reference. 065 * @return referenced object 066 */ 067 public Object getReference() { 068 return _ref; 069 } 070 071 /** 072 * Provide a string representation of the token. 073 * @return string representation of the token 074 */ 075 @Override 076 public String toString() { 077 return _ref.toString(); 078 } 079 080 /////////////////////////////////////////////////////////////////// 081 //// private fields //// 082 083 /** 084 * Holds the reference to some object. 085 */ 086 private Object _ref; 087}