pnuts.lang
Class BinaryOperator

java.lang.Object
  extended by pnuts.lang.BinaryOperator
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
BinaryOperator.Add, BinaryOperator.And, BinaryOperator.Divide, BinaryOperator.Mod, BinaryOperator.Multiply, BinaryOperator.Or, BinaryOperator.ShiftArithmetic, BinaryOperator.ShiftLeft, BinaryOperator.ShiftRight, BinaryOperator.Subtract, BinaryOperator.Xor

public abstract class BinaryOperator
extends java.lang.Object
implements java.io.Serializable

Abstract base class of binary operations

See Also:
BooleanOperator, Serialized Form

Nested Class Summary
static class BinaryOperator.Add
          The default implementation of + operator
static class BinaryOperator.And
          The default implementation of & operator
static class BinaryOperator.Divide
          The default implementation of / operator
static class BinaryOperator.Mod
          The default implementation of % operator
static class BinaryOperator.Multiply
          The default implementation of * operator
static class BinaryOperator.Or
          The default implementation of | operator (bitwise OR)
static class BinaryOperator.ShiftArithmetic
          The default implementation of >>> operator
static class BinaryOperator.ShiftLeft
          The default implementation of < operator
static class BinaryOperator.ShiftRight
          The default implementation of > operator
static class BinaryOperator.Subtract
          The default implementation of - operator
static class BinaryOperator.Xor
          The default implementation of ^ operator
 
Constructor Summary
BinaryOperator()
           
 
Method Summary
protected static java.lang.Number compressNumber(java.lang.Number n)
           
protected  java.lang.Object op_bdec(java.math.BigDecimal d1, java.math.BigDecimal d2)
          Operation on BigDecimal's
protected  java.lang.Object op_bint(java.math.BigInteger b1, java.math.BigInteger b2)
          Operation on BigInteger's
protected  java.lang.Object op_boolean(boolean b1, boolean b2)
          Operation on booleans
protected  java.lang.Object op_double(double d1, double d2)
          Operation on doubles
protected  java.lang.Object op_float(float f1, float f2)
          Operation on floats
protected  java.lang.Object op_int(int i1, int i2)
          Operation on ints
protected  java.lang.Object op_long(long l1, long l2)
          Operation on longs
protected  java.lang.Object op_numeric(Numeric n1, java.lang.Object n2)
          Operation on a Numeric and an Object
protected  java.lang.Object op_numeric(java.lang.Object n1, Numeric n2)
          Operation on an Object and a Numeric
protected  java.lang.Object op_object(java.lang.Object o1, java.lang.Object o2)
          Operation on Object's
protected  java.lang.Object op_string(java.lang.Object n1, java.lang.String n2)
          Operation on an Object and a String
protected  java.lang.Object op_string(java.lang.String n1, java.lang.Object n2)
          Operation on a String and an Object
 java.lang.Object operateOn(java.lang.Object n1, java.lang.Object n2)
          Dispatches a binary expression to a particular operation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinaryOperator

public BinaryOperator()
Method Detail

op_int

protected java.lang.Object op_int(int i1,
                                  int i2)
Operation on ints


op_long

protected java.lang.Object op_long(long l1,
                                   long l2)
Operation on longs


op_float

protected java.lang.Object op_float(float f1,
                                    float f2)
Operation on floats


op_double

protected java.lang.Object op_double(double d1,
                                     double d2)
Operation on doubles


op_bdec

protected java.lang.Object op_bdec(java.math.BigDecimal d1,
                                   java.math.BigDecimal d2)
Operation on BigDecimal's


op_bint

protected java.lang.Object op_bint(java.math.BigInteger b1,
                                   java.math.BigInteger b2)
Operation on BigInteger's


op_numeric

protected java.lang.Object op_numeric(Numeric n1,
                                      java.lang.Object n2)
Operation on a Numeric and an Object


op_numeric

protected java.lang.Object op_numeric(java.lang.Object n1,
                                      Numeric n2)
Operation on an Object and a Numeric


op_object

protected java.lang.Object op_object(java.lang.Object o1,
                                     java.lang.Object o2)
Operation on Object's


op_string

protected java.lang.Object op_string(java.lang.String n1,
                                     java.lang.Object n2)
Operation on a String and an Object


op_string

protected java.lang.Object op_string(java.lang.Object n1,
                                     java.lang.String n2)
Operation on an Object and a String


op_boolean

protected java.lang.Object op_boolean(boolean b1,
                                      boolean b2)
Operation on booleans


operateOn

public java.lang.Object operateOn(java.lang.Object n1,
                                  java.lang.Object n2)
Dispatches a binary expression to a particular operation


compressNumber

protected static java.lang.Number compressNumber(java.lang.Number n)