Class: DefConditional

algeobra~DefConditional()

Definition of a conditional expression, that defines objects based on some condtion

Constructor

new DefConditional()

Source:

Methods

compute(info) → {*}

Computes the conditional expression
Parameters:
Name Type Description
info CreateInfo The creation info
Source:
Returns:
An object based on the inputs
Type
*

(static) fromCondition(obj, condition) → {CreateInfo}

Defines an object based on a condition. If the condition is true, the given object value will be returned, otherwise INVALID
Parameters:
Name Type Description
obj Number | Object Either the index or value of an object
condition Number | Object Either the index or value of a TYPE_BOOLEAN. The condition value
Source:
Returns:
The creation info
Type
CreateInfo

(static) fromEitherOr(obj0, obj1, condition) → {CreateInfo}

Defines an object based on a condition. If the condition is true, the first object value will be returned, otherwise the second
Parameters:
Name Type Description
obj0 Number | Object Either the index or value of an object
obj1 Number | Object Either the index or value of an object
condition Number | Object Either the index or value of a TYPE_BOOLEAN. The condition value
Source:
Returns:
The creation info
Type
CreateInfo