Package org.yamcs.xtce
Enum MathOperator
- java.lang.Object
-
- java.lang.Enum<MathOperator>
-
- org.yamcs.xtce.MathOperator
-
- All Implemented Interfaces:
Serializable,Comparable<MathOperator>
public enum MathOperator extends Enum<MathOperator>
Mathematical operators used in the math operation. Behaviour of each operator on the stack is described using notation (before -- after), where "before" represents the stack before execution of the operator and "after" represent the stack after execution.The top of the stack is at the right, e.g. in (x1 x2 -- x1-x2), x2 is the element on the top, x1 is the second from the top and (x1-x2) is the top of the frame after the execution.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ABSabsolute value (x1 -- abs(x1))ACOSarccosine (x -- acos\(x)) radiansACOSHhyperbolic arccosine (x -- acosh\(x))ASINarcsine (x -- asin\(x)) radiansASINHhyperbolic arcsine (x -- asinh\(x))ATANarctangent (x -- atan\(x)) radiansATANHhyperbolic arctangent (x -- atanh\(x))BITWISE_ANDbitwise and (x1 x2 -- x1 & x2)BITWISE_ORbitwise or (x1 x2 -- x1 | x2)COScosine (x -- cos\(x)) radiansCOSHhyperbolic cosine (x -- cosh\(x))DIVdivision (x1 x2 -- x1/x2) An undefined condition exists if x2 is zeroDROPRemove top item from the stack (x -- )DUPDuplicate top item on the stack (x -- x x)EXPexponentiation (x -- exp(x))FACTfactorial (x -- x!)INVinversion (x -- 1/x) An undefined condition exists if x is zeroLEFT_SHIFTbitwise right shift (x1 x2 -- x1 >> x2)LNnatural (base e) logarithm (x -- ln(x)) An undefined condition exists if x is less than or equal to zeroLOGbase-10 logarithm (x-- log(x)) An undefined condition exists if x is less than or equal to zeroMINUSsubtraction (x1 x2 -- x1-x2)MODULOunsigned mod (x1 x2 -- x3) Divide x1 by x2, giving the remainder x3; an undefined condition exists if x2 is zeroOVERDuplicate second item to the top of the stack (x1 x2 -- x1 x2 x1)PLUSaddition (x1 x2 -- x1+x2)POWpower function (x1 x2 -- x1**x2)REVPOWreverse power function (x1 x2 -- x2**x1)RIGHT_SHIFTbitwise left shift (x1 x2 -- x1 << x2)SINsine (x -- sin\(x)) radiansSINHhyperbolic sine (x -- sinh\(x))STARmultiplication (x1 x2 -- x1*x2)SWAPswap the top two stack items (x1 x2 -- x2 x1)TANtangent (x -- tan\(x)) radiansTANHhyperbolic tangent (x -- tanh(x))
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MathOperatorfromXtceName(String s)intgetArity()static MathOperatorvalueOf(String name)Returns the enum constant of this type with the specified name.static MathOperator[]values()Returns an array containing the constants of this enum type, in the order they are declared.StringxtceName()
-
-
-
Enum Constant Detail
-
PLUS
public static final MathOperator PLUS
addition (x1 x2 -- x1+x2)
-
MINUS
public static final MathOperator MINUS
subtraction (x1 x2 -- x1-x2)
-
STAR
public static final MathOperator STAR
multiplication (x1 x2 -- x1*x2)
-
DIV
public static final MathOperator DIV
division (x1 x2 -- x1/x2) An undefined condition exists if x2 is zero
-
MODULO
public static final MathOperator MODULO
unsigned mod (x1 x2 -- x3) Divide x1 by x2, giving the remainder x3; an undefined condition exists if x2 is zero
-
POW
public static final MathOperator POW
power function (x1 x2 -- x1**x2)
-
REVPOW
public static final MathOperator REVPOW
reverse power function (x1 x2 -- x2**x1)
-
LN
public static final MathOperator LN
natural (base e) logarithm (x -- ln(x)) An undefined condition exists if x is less than or equal to zero
-
LOG
public static final MathOperator LOG
base-10 logarithm (x-- log(x)) An undefined condition exists if x is less than or equal to zero
-
EXP
public static final MathOperator EXP
exponentiation (x -- exp(x))
-
INV
public static final MathOperator INV
inversion (x -- 1/x) An undefined condition exists if x is zero
-
FACT
public static final MathOperator FACT
factorial (x -- x!) An undefined condition exists if x is less than zero
-
TAN
public static final MathOperator TAN
tangent (x -- tan\(x)) radians
-
COS
public static final MathOperator COS
cosine (x -- cos\(x)) radians
-
SIN
public static final MathOperator SIN
sine (x -- sin\(x)) radians
-
ATAN
public static final MathOperator ATAN
arctangent (x -- atan\(x)) radians
-
ACOS
public static final MathOperator ACOS
arccosine (x -- acos\(x)) radians
-
ASIN
public static final MathOperator ASIN
arcsine (x -- asin\(x)) radians
-
TANH
public static final MathOperator TANH
hyperbolic tangent (x -- tanh(x))
-
COSH
public static final MathOperator COSH
hyperbolic cosine (x -- cosh\(x))
-
SINH
public static final MathOperator SINH
hyperbolic sine (x -- sinh\(x))
-
ATANH
public static final MathOperator ATANH
hyperbolic arctangent (x -- atanh\(x))An undefined condition exists if x is outside the range [-1.0,+1.0]
-
ACOSH
public static final MathOperator ACOSH
hyperbolic arccosine (x -- acosh\(x))An undefined condition exists if n is less than one
-
ASINH
public static final MathOperator ASINH
hyperbolic arcsine (x -- asinh\(x))
-
SWAP
public static final MathOperator SWAP
swap the top two stack items (x1 x2 -- x2 x1)
-
DROP
public static final MathOperator DROP
Remove top item from the stack (x -- )
-
DUP
public static final MathOperator DUP
Duplicate top item on the stack (x -- x x)
-
OVER
public static final MathOperator OVER
Duplicate second item to the top of the stack (x1 x2 -- x1 x2 x1)
-
ABS
public static final MathOperator ABS
absolute value (x1 -- abs(x1))
-
LEFT_SHIFT
public static final MathOperator LEFT_SHIFT
bitwise right shift (x1 x2 -- x1 >> x2)
-
RIGHT_SHIFT
public static final MathOperator RIGHT_SHIFT
bitwise left shift (x1 x2 -- x1 << x2)
-
BITWISE_OR
public static final MathOperator BITWISE_OR
bitwise or (x1 x2 -- x1 | x2)
-
BITWISE_AND
public static final MathOperator BITWISE_AND
bitwise and (x1 x2 -- x1 & x2)
-
-
Method Detail
-
values
public static MathOperator[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (MathOperator c : MathOperator.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static MathOperator valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getArity
public int getArity()
-
fromXtceName
public static MathOperator fromXtceName(String s)
-
xtceName
public String xtceName()
-
-