001/* An interface for tokens that support bitwise operations.
002
003 Copyright (c) 2002-2013 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 */
027package ptolemy.data;
028
029import ptolemy.kernel.util.IllegalActionException;
030
031///////////////////////////////////////////////////////////////////
032//// BitwiseOperationToken
033
034/**
035 The operations that can be performed on tokens that have bitwise operations.
036
037 @author Steve Neuendorffer
038 @version $Id$
039 @since Ptolemy II 2.1
040 @Pt.ProposedRating Green (neuendor)
041 @Pt.AcceptedRating Yellow (wbwu)
042 */
043public interface BitwiseOperationToken {
044    ///////////////////////////////////////////////////////////////////
045    ////                         public methods                    ////
046
047    /** Returns a token representing the bitwise AND of this token and
048     *  the given token.
049     *  @param rightArgument  The token that is bitwise ANDed with this token.
050     *  @return The bitwise AND.
051     *  @exception IllegalActionException If the given token is not
052     *  compatible for this operation, or the operation does not make
053     *  sense for this type.
054     */
055    public BitwiseOperationToken bitwiseAnd(Token rightArgument)
056            throws IllegalActionException;
057
058    /** Returns a token representing the bitwise NOT of this token.
059     *  @return The bitwise NOT of this token.
060     *  @exception IllegalActionException If the given token is not
061     *  compatible for this operation, or the operation does not make
062     *  sense for this type.
063     */
064    public BitwiseOperationToken bitwiseNot() throws IllegalActionException;
065
066    /** Returns a token representing the bitwise OR of this token and
067     *  the given token.
068     *  @param rightArgument  The token that is bitwise OR'd with this token.
069     *  @return The bitwise OR.
070     *  @exception IllegalActionException If the given token is not
071     *  compatible for this operation, or the operation does not make
072     *  sense for this type.
073     */
074    public BitwiseOperationToken bitwiseOr(Token rightArgument)
075            throws IllegalActionException;
076
077    /** Returns a token representing the bitwise XOR of this token and
078     *  the given token.
079     *  @param rightArgument  The token that is bitwise XOR'd with this token.
080     *  @return The bitwise XOR.
081     *  @exception IllegalActionException If the given token is not
082     *  compatible for this operation, or the operation does not make
083     *  sense for this type.
084     */
085    public BitwiseOperationToken bitwiseXor(Token rightArgument)
086            throws IllegalActionException;
087}