Package org.zkoss.pivot.impl.calc
Class Numbers.MixedTypedNumber
java.lang.Object
org.zkoss.pivot.impl.calc.Numbers.MixedTypedNumber
- Enclosing class:
- Numbers
- Author:
- simonpai
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMixedTypedNumber(byte initType, int initInt, long initLong, double initDouble) MixedTypedNumber(int initValue) -
Method Summary
Modifier and TypeMethodDescriptionbytegetType()getValue()protected voidinit()voidvoidvoidvoidoperate(Numbers.MixedTypedNumber mtn, boolean autoUpType) protected abstract doubleoperateDouble(double operand1, double operand2) protected abstract intoperateInt(int operand1, int operand2) protected abstract longoperateLong(long operand1, long operand2) protected doubleoperateNullDouble(double operand1) protected intoperateNullInt(int operand1) protected longoperateNullLong(long operand1) voidupType(byte newType) void
-
Field Details
-
_type
public byte _type -
_int
public int _int -
_long
public long _long -
_double
public double _double
-
-
Constructor Details
-
MixedTypedNumber
public MixedTypedNumber() -
MixedTypedNumber
public MixedTypedNumber(int initValue) - Parameters:
initValue- The zero element of the operator. For example, 0 for sum and 1 for product.
-
MixedTypedNumber
public MixedTypedNumber(byte initType, int initInt, long initLong, double initDouble) - Parameters:
initType-initInt-initLong-initDouble-
-
-
Method Details
-
init
protected void init() -
upType
public void upType(byte newType) - Parameters:
newType- eitherNumbers.INTEGER,Numbers.LONG, orNumbers.DOUBLE
-
upTypeFor
-
getType
public byte getType() -
getValue
-
operate
- Parameters:
mtn-
-
operate
- Parameters:
mtn-autoUpType-
-
operate
-
operate
-
operateInt
protected abstract int operateInt(int operand1, int operand2) -
operateLong
protected abstract long operateLong(long operand1, long operand2) -
operateDouble
protected abstract double operateDouble(double operand1, double operand2) -
operateNullInt
protected int operateNullInt(int operand1) -
operateNullLong
protected long operateNullLong(long operand1) -
operateNullDouble
protected double operateNullDouble(double operand1)
-