gnu.kawa.functions
Class BitwiseOp

java.lang.Object
  extended by gnu.mapping.PropertySet
      extended by gnu.mapping.Procedure
          extended by gnu.mapping.ProcedureN
              extended by gnu.kawa.functions.ArithOp
                  extended by gnu.kawa.functions.BitwiseOp
All Implemented Interfaces:
Named

public class BitwiseOp
extends ArithOp


Field Summary
static BitwiseOp and
           
static BitwiseOp ashift
           
static BitwiseOp ashiftl
           
static BitwiseOp ashiftr
           
static BitwiseOp ior
           
static BitwiseOp not
           
static BitwiseOp xor
           
 
Fields inherited from class gnu.kawa.functions.ArithOp
AND, ASHIFT_GENERAL, ASHIFT_LEFT, ASHIFT_RIGHT, DIVIDE_GENERIC, DIVIDE_INEXACT, IOR, LSHIFT_RIGHT, MODULO, NOT, QUOTIENT, QUOTIENT_EXACT, XOR
 
Fields inherited from class gnu.mapping.ProcedureN
noArgs
 
Fields inherited from class gnu.mapping.Procedure
compilerKey, validateApplyKey
 
Fields inherited from class gnu.mapping.PropertySet
nameKey
 
Constructor Summary
BitwiseOp(java.lang.String name, int op)
           
 
Method Summary
 java.lang.Object adjustResult(IntNum value, int code)
           
 java.lang.Object apply1(java.lang.Object arg1)
           
 java.lang.Object apply2(java.lang.Object arg1, java.lang.Object arg2)
           
 java.lang.Object applyN(java.lang.Object[] args)
           
static int checkNonNegativeShift(Procedure proc, int amount)
           
 java.lang.Object defaultResult()
           
 int numArgs()
          Return minArgs()|(maxArgs<<12).
static IntNum shiftLeft(IntNum value, int count)
           
static IntNum shiftRight(IntNum value, int count)
           
 
Methods inherited from class gnu.kawa.functions.ArithOp
classify, isSideEffectFree
 
Methods inherited from class gnu.mapping.ProcedureN
apply0, apply3, apply4
 
Methods inherited from class gnu.mapping.Procedure
apply, apply, check0, check1, check2, check3, check4, checkArgCount, checkN, getReturnType, getSetter, getSourceLocation, match0, match1, match2, match3, match4, matchN, maxArgs, maxArgs, minArgs, minArgs, set0, set1, setN, setSetter, setSourceLocation, toString
 
Methods inherited from class gnu.mapping.PropertySet
getName, getProperty, getSymbol, removeProperty, setName, setProperty, setProperty, setSymbol
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

and

public static final BitwiseOp and

ior

public static final BitwiseOp ior

xor

public static final BitwiseOp xor

ashift

public static final BitwiseOp ashift

ashiftl

public static final BitwiseOp ashiftl

ashiftr

public static final BitwiseOp ashiftr

not

public static final BitwiseOp not
Constructor Detail

BitwiseOp

public BitwiseOp(java.lang.String name,
                 int op)
Method Detail

defaultResult

public java.lang.Object defaultResult()
Overrides:
defaultResult in class ArithOp

adjustResult

public java.lang.Object adjustResult(IntNum value,
                                     int code)

apply1

public java.lang.Object apply1(java.lang.Object arg1)
Overrides:
apply1 in class ProcedureN

apply2

public java.lang.Object apply2(java.lang.Object arg1,
                               java.lang.Object arg2)
Overrides:
apply2 in class ProcedureN

applyN

public java.lang.Object applyN(java.lang.Object[] args)
Specified by:
applyN in class ProcedureN

checkNonNegativeShift

public static int checkNonNegativeShift(Procedure proc,
                                        int amount)

shiftLeft

public static IntNum shiftLeft(IntNum value,
                               int count)

shiftRight

public static IntNum shiftRight(IntNum value,
                                int count)

numArgs

public int numArgs()
Description copied from class: Procedure
Return minArgs()|(maxArgs<<12). We use a single virtual function to reduce the number of methods in the system, as well as the number of virtual method table entries. We shift by 12 so the number can normally be represented using a sipush instruction, without requiring a constant pool entry.

Overrides:
numArgs in class Procedure