Factor

com.phasmidsoftware.number.expression.parse.ArithmeticParser.Factor
abstract class Factor extends Expression

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 show(indent: Int): String

Displays a textual representation of the expression with the specified indentation.

Displays a textual representation of the expression with the specified indentation.

Value parameters

indent

the number of spaces to prepend to each line of the output, used to control indentation.

Attributes

Returns

a string representing the formatted expression.

Inherited from:
Expression
def value: Try[ArithmeticParser.this.T]

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[T] containing either the result of the evaluation or an error.

Inherited from:
Expression