Class DayMonthNameFunction

All Implemented Interfaces:
NamedExpression, HasSQL, Typed

public final class DayMonthNameFunction extends Function1
A DAYNAME() or MONTHNAME() function.
  • Field Details

    • DAYNAME

      public static final int DAYNAME
      DAYNAME() (non-standard).
      See Also:
    • MONTHNAME

      public static final int MONTHNAME
      MONTHNAME() (non-standard).
      See Also:
    • NAMES

      private static final String[] NAMES
    • MONTHS_AND_WEEKS

      private static volatile String[][] MONTHS_AND_WEEKS
      English names of months and week days.
    • function

      private final int function
  • Constructor Details

    • DayMonthNameFunction

      public DayMonthNameFunction(Expression arg, int function)
  • Method Details

    • getValue

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

      private static String[] getMonthsAndWeeks(int field)
      Return names of month or weeks.
      Parameters:
      field - 0 for months, 1 for weekdays
      Returns:
      names of month or weeks
    • 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
    • getName

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