Factor

com.phasmidsoftware.number.expression.parse.ExpressionParser.Factor
abstract class Factor extends Tokens

Represents a factor in an expression.

The Factor class is an abstraction used to build the components of mathematical or logical expressions. It serves as a fundamental unit which can be combined with other components to form more complex expressions.

This class extends the Expression trait, inheriting capabilities for evaluation and display. Instances of Factor must provide concrete implementations for the abstract methods defined in Expression.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Inherited and Abstract methods

def value: Try[Expression]

Evaluates the expression and returns the result wrapped in a Try. The Try indicates whether the evaluation was successful (Success) or resulted in an error (Failure).

Evaluates the expression and returns the result wrapped in a Try. The Try indicates whether the evaluation was successful (Success) or resulted in an error (Failure).

Attributes

Returns

a Try[Expression] containing either the result of the evaluation or an error.

Inherited from:
Tokens