CompositeExpression

com.phasmidsoftware.number.expression.expr.CompositeExpression
See theCompositeExpression companion trait

Companion object for the CompositeExpression case class.

Provides a utility method to create an Expression from a function and a sequence of Expressions.

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

Applies a given ExpressionBiFunction to a sequence of Expression instances and returns a corresponding Expression based on the sequence's contents.

Applies a given ExpressionBiFunction to a sequence of Expression instances and returns a corresponding Expression based on the sequence's contents.

Value parameters

f

The ExpressionBiFunction used to combine or process the given expressions.

xs

The sequence of Expression instances to which the function is applied. The sequence must not be empty.

Attributes

Returns

An Expression resulting from the specified processing: - If the sequence is empty, an IllegalArgumentException is thrown. - If the sequence contains a single element, that element is returned. - If the sequence contains two elements, a BiFunction expression is returned. - Otherwise, an Aggregate expression is created from the sequence.

Creates a composite expression by applying a given ExpressionBiFunction to a sequence of eager values.

Creates a composite expression by applying a given ExpressionBiFunction to a sequence of eager values.

This method maps each Eager value to a literal expression and then applies the provided function to generate the resulting expression.

Value parameters

f

The ExpressionBiFunction used to combine or process the expressions derived from the given eager values.

xs

A variable-length argument list of Eager values which will be converted into literal expressions before applying the function.

Attributes

Returns

An Expression resulting from applying the function to the sequence of literal expressions.