Package com.singularsys.jep.misc.functions

# Class Range

java.lang.Object
com.singularsys.jep.functions.PostfixMathCommand
com.singularsys.jep.functions.BinaryFunction
com.singularsys.jep.misc.functions.Range

All Implemented Interfaces:
  `PostfixMathCommandI`, `Serializable`

public class Range extends BinaryFunction
A function which returns an increasing sequence of all the items between the end points inclusive.

     [1..10]

This is typically used with the `RangeOperator` and a modified parser such as `ConfigurableParserWithRange`.

      OperatorTable2 optab = new StandardOperatorTable2();
      Operator rangeOp = new RangeOperator("..", "[", "]", new Range(), Operator.BINARY+Operator.NOT_IN_PARSER);
      optab.insertOperator(OperatorTable2.SpecialOperators.RANGE , rangeOp, optab.getAssign());
      ConfigurableParser cp = new ConfigurableParserWithRange("..");
      Jep jep = new Jep(cp,optab);

Since:
  Jep 4.1
See Also:
  - `RangeOperator`
  - `ConfigurableParserWithRange`
  - Serialized Form

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class com.singularsys.jep.functions.BinaryFunction

  `BinaryFunction.BiFunctionWithException<T>`

- ## Field Summary

  ### Fields inherited from class com.singularsys.jep.functions.PostfixMathCommand

  `curNumberOfParameters, description, name, NaN, numberOfParameters`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Range()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Object`
  `eval(Object l, Object r)`
  Evaluate the function.

  ### Methods inherited from class com.singularsys.jep.functions.BinaryFunction

  `instanceOf, instanceOf, instanceOf, instanceOf, run`

  ### Methods inherited from class com.singularsys.jep.functions.PostfixMathCommand

  `asArray, asBool, asDouble, asInt, asLong, asStrictInt, asString, asType, checkNumberOfParameters, getDescription, getDescription, getDescriptionWithType, getName, getNumberOfParameters, setCurNumberOfParameters, setDescription, setName, toString, toString`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### Range

    public Range()

- ## Method Details

  - ### eval

    public Object eval(Object l, Object r) throws EvaluationException
    Evaluate the function. The arguments should be numbers, and the result is a vector of all the numbers between the end points inclusive. Both end points are cast to ints, and rounded if necessary
    Specified by:
      `eval` in class `BinaryFunction`
    Parameters:
      `l` - the lower bound
      `r` - the upper bound
    Returns:
      a vector of Double values, or an empty vector if `r < l`.
    Throws:
      `EvaluationException` - if the function cannot be evaluated.