001/* A operation taking two operands of type int, and producing a value of 002 type int. 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.IntegerBinaryOperation; 033 034/** A operation taking two operands of type int, and producing a value of 035 type int. This interface attempts to mimic a first-class function of two 036 variables. 037 038 @author Christopher Hylands 039 @version $Id$ 040 @since Ptolemy II 2.0 041 @Pt.ProposedRating Red (ctsay) 042 @Pt.AcceptedRating Red (ctsay) 043 */ 044public class TestIntegerBinaryOperation implements IntegerBinaryOperation { 045 /** Operate on the operands, returning a value of the same 046 * type. Note that the operation need not be commutative. 047 */ 048 @Override 049 public int operate(int leftOperand, int rightOperand) { 050 return leftOperand - rightOperand; 051 } 052}