Class Function

java.lang.Object
com.fathzer.soft.javaluator.Function

public class Function extends Object
Author:
Jean-Marc Astesana
See Also:
  • Constructor Details

    • Function

      public Function(String name, int argumentCount)
      Constructor.
      This constructor builds a function with a fixed arguments count.
      Parameters:
      name - The function's name
      argumentCount - The function's argument count.
      Throws:
      IllegalArgumentException - if argumentCount is lower than 0 or if the function name is null or empty.
    • Function

      public Function(String name, int minArgumentCount, int maxArgumentCount)
      Constructor.
      This constructor builds a function with a variable arguments count.
      For instance, a minimum function may have at least one argument.
      Parameters:
      name - The function's name
      minArgumentCount - The function's minimum argument count.
      maxArgumentCount - The function's maximum argument count (Integer.MAX_VALUE to specify no upper limit).
      Throws:
      IllegalArgumentException - if minArgumentCount is less than 0 or greater than maxArgumentCount or if the function name is null or empty.
  • Method Details

    • getName

      public String getName()
      Gets the function's name.
      Returns:
      the name of the function
    • getMinimumArgumentCount

      public int getMinimumArgumentCount()
      Gets the function's minimum argument count.
      Returns:
      an integer
    • getMaximumArgumentCount

      public int getMaximumArgumentCount()
      Gets the function's maximum argument count.
      Returns:
      an integer