Top Description Fields Constructors Methods
org.apache.poi.ss.formula.atp

pack-priv final Class RandBetween

extends Object
implements FreeRefFunction
Class Inheritance
All Implemented Interfaces
org.apache.poi.ss.formula.functions.FreeRefFunction
Imports
org.apache.poi.ss.formula.eval.ErrorEval, .EvaluationException, .NumberEval, .OperandResolver, .ValueEval, org.apache.poi.ss.formula.functions.FreeRefFunction, org.apache.poi.ss.formula.OperationEvaluationContext

Implementation of Excel 'Analysis ToolPak' function RANDBETWEEN()
Returns a random integer number between the numbers you specify.

Syntax
RANDBETWEEN(bottom, top)

bottom is the smallest integer RANDBETWEEN will return.
top is the largest integer RANDBETWEEN will return.

Field Summary

Modifier and TypeField and Description
public static final FreeRefFunction

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public ValueEval
evaluate(ValueEval[]
the pre-evaluated arguments for this function. args is never null, nor are any of its elements.
args
,
OperationEvaluationContext
primarily used to identify the source cell containing the formula being evaluated. may also be used to dynamically create reference evals.
ec
)

Implements org.apache.poi.ss.formula.functions.FreeRefFunction.evaluate.

Evaluate for RANDBETWEEN().

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

instanceback to summary
public static final FreeRefFunction instance

Constructor Detail

RandBetweenback to summary
private RandBetween()

Method Detail

evaluateback to summary
public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec)

Implements org.apache.poi.ss.formula.functions.FreeRefFunction.evaluate.

Evaluate for RANDBETWEEN(). Must be given two arguments. Bottom must be greater than top. Bottom is rounded up and top value is rounded down. After rounding top has to be set greater than top.

Parameters
args:ValueEval[]

Doc from org.apache.poi.ss.formula.functions.FreeRefFunction.evaluate.

the pre-evaluated arguments for this function. args is never null, nor are any of its elements.

ec:OperationEvaluationContext

Doc from org.apache.poi.ss.formula.functions.FreeRefFunction.evaluate.

primarily used to identify the source cell containing the formula being evaluated. may also be used to dynamically create reference evals.

Returns:ValueEval

Doc from org.apache.poi.ss.formula.functions.FreeRefFunction.evaluate.

never null. Possibly an instance of ErrorEval in the case of a specified Excel error (Exceptions are never thrown to represent Excel errors).

See Also
org.apache.poi.ss.formula.functions.FreeRefFunction#evaluate(org.apache.poi.ss.formula.eval.ValueEval[], org.apache.poi.ss.formula.OperationEvaluationContext)