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
    absolute value (x1 -- abs(x1))
    arccosine (x -- acos\(x)) radians
    hyperbolic arccosine (x -- acosh\(x))
    arcsine (x -- asin\(x)) radians
    hyperbolic arcsine (x -- asinh\(x))
    arctangent (x -- atan\(x)) radians
    hyperbolic arctangent (x -- atanh\(x))
    bitwise and (x1 x2 -- x1 & x2)
    bitwise or (x1 x2 -- x1 | x2)
    cosine (x -- cos\(x)) radians
    hyperbolic cosine (x -- cosh\(x))
    division (x1 x2 -- x1/x2) An undefined condition exists if x2 is zero
    Remove top item from the stack (x -- )
    Duplicate top item on the stack (x -- x x)
    exponentiation (x -- exp(x))
    factorial (x -- x!)
    inversion (x -- 1/x) An undefined condition exists if x is zero
    bitwise right shift (x1 x2 -- x1 >> x2)
    natural (base e) logarithm (x -- ln(x)) An undefined condition exists if x is less than or equal to zero
    base-10 logarithm (x-- log(x)) An undefined condition exists if x is less than or equal to zero
    subtraction (x1 x2 -- x1-x2)
    unsigned mod (x1 x2 -- x3) Divide x1 by x2, giving the remainder x3; an undefined condition exists if x2 is zero
    Duplicate second item to the top of the stack (x1 x2 -- x1 x2 x1)
    addition (x1 x2 -- x1+x2)
    power function (x1 x2 -- x1**x2)
    reverse power function (x1 x2 -- x2**x1)
    bitwise left shift (x1 x2 -- x1 << x2)
    sine (x -- sin\(x)) radians
    hyperbolic sine (x -- sinh\(x))
    multiplication (x1 x2 -- x1*x2)
    swap the top two stack items (x1 x2 -- x2 x1)
    tangent (x -- tan\(x)) radians
    hyperbolic tangent (x -- tanh(x))
  • Method Summary

    Modifier and Type
    Method
    Description
     
    int
     
    Returns the enum constant of this type with the specified name.
    static MathOperator[]
    Returns an array containing the constants of this enum type, in the order they are declared.
     

    Methods inherited from class java.lang.Enum

    clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • 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 Details

    • values

      public static MathOperator[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      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 name
      NullPointerException - if the argument is null
    • getArity

      public int getArity()
    • fromXtceName

      public static MathOperator fromXtceName(String s)
    • xtceName

      public String xtceName()