Class SwitchNonLazy

All Implemented Interfaces:
PostfixMathCommandI, Serializable

public class SwitchNonLazy extends NaryFunction
A switch statement. The argument is selected based on the integer value of the first argument for example switch(2,5,6,7,8) will return 6. The first argument must be an exact integer.

This is the non-lazy version of the function, all arguments are evaluated before the switch statement is executed. See Switch for the lazy evaluation version.

Since:
Jep 4.1
Author:
Richard Morris
See Also:
  • Constructor Details

    • SwitchNonLazy

      public SwitchNonLazy()
      Default switch statement. Exceptions are thrown if first argument is null.
    • SwitchNonLazy

      public SwitchNonLazy(SwitchNonLazy.NullBehaviour nullBehaviour)
      Switch function with defined null behaviour.
      Parameters:
      nullBehaviour - action to take if first argument is null.
      Since:
      Jep 3.5
  • Method Details