Class GCDFunction

All Implemented Interfaces:
ExpressionWithVariableParameters, NamedExpression, HasSQL, Typed

public class GCDFunction extends FunctionN
GCD and LCM functions.
  • Field Details

    • GCD

      public static final int GCD
      GCD() (non-standard).
      See Also:
    • LCM

      public static final int LCM
      LCM() (non-standard).
      See Also:
    • MAX_BIT_LENGTH

      public static final int MAX_BIT_LENGTH
  • Constructor Details

    • GCDFunction

      public GCDFunction(int function)
  • Method Details

    • getValue

      public Value getValue(SessionLocal session)
      Description copied from class: Expression
      Return the resulting value for the current row.
      Overrides:
      getValue in class FunctionN
      Parameters:
      session - the session
      Returns:
      the result
    • optimize

      public Expression optimize(SessionLocal session)
      Description copied from class: Expression
      Try to optimize the expression.
      Specified by:
      optimize in class Expression
      Parameters:
      session - the session
      Returns:
      the optimized expression
    • checkType

      public static boolean checkType(Expression e, String name)
      Checks type of GCD, LCM, GCD_AGG, or LCM_AGG argument.
      Parameters:
      e - the argument
      name - the name of the function
      Returns:
      true if argument has NULL data type, false otherwise
    • getName

      public String getName()
      Description copied from interface: NamedExpression
      Get the name.
      Returns:
      the name in uppercase