001/* A operation taking one operand of type Complex, and producing a value of 002 type Complex. 003 004 Copyright (c) 1998-2014 The Regents of the University of California. 005 All rights reserved. 006 007 Permission is hereby granted, without written agreement and without 008 license or royalty fees, to use, copy, modify, and distribute this 009 software and its documentation for any purpose, provided that the above 010 copyright notice and the following two paragraphs appear in all copies 011 of this software. 012 013 IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY 014 FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 015 ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF 016 THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF 017 SUCH DAMAGE. 018 019 THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, 020 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 021 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE 022 PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF 023 CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, 024 ENHANCEMENTS, OR MODIFICATIONS. 025 026 PT_COPYRIGHT_VERSION_2 027 COPYRIGHTENDKEY 028 029 */ 030package ptolemy.math.test; 031 032import ptolemy.math.Complex; 033import ptolemy.math.ComplexBinaryOperation; 034 035/** A operation taking one argument of type Complex, and producing a value of 036 type Complex. This interface attempts to mimic a first-class function of 037 a single variable. 038 039 @author Christopher Hylands 040 @version $Id$ 041 @since Ptolemy II 2.0 042 @Pt.ProposedRating Red (ctsay) 043 @Pt.AcceptedRating Red (ctsay) 044 */ 045public class TestComplexBinaryOperation implements ComplexBinaryOperation { 046 /** Operate on the operands, returning a value of the same 047 * type. Note that the operation need not be commutative; 048 */ 049 @Override 050 public Complex operate(Complex leftOperand, Complex rightOperand) { 051 return leftOperand.subtract(rightOperand); 052 } 053}