Class Assign
- Namespace
- xFunc.Maths.Expressions
- Assembly
- xFunc.Maths.dll
Represents the ":=" operator and the assign function.
public class Assign : IExpression
- Inheritance
-
Assign
- Implements
- Inherited Members
- Extension Methods
Constructors
Assign(Variable, IExpression)
Initializes a new instance of the Assign class.
public Assign(Variable key, IExpression value)
Parameters
key
VariableThe key.
value
IExpressionThe value.
Exceptions
- ArgumentNullException
key
orvalue
is null.
Properties
Key
Gets the key.
public Variable Key { get; }
Property Value
Value
Gets the value.
public IExpression Value { get; }
Property Value
Methods
Analyze<TResult>(IAnalyzer<TResult>)
Analyzes the current expression.
public TResult Analyze<TResult>(IAnalyzer<TResult> analyzer)
Parameters
analyzer
IAnalyzer<TResult>The analyzer.
Returns
- TResult
The analysis result.
Type Parameters
TResult
The type of the result.
Analyze<TResult, TContext>(IAnalyzer<TResult, TContext>, TContext)
Analyzes the current expression.
public TResult Analyze<TResult, TContext>(IAnalyzer<TResult, TContext> analyzer, TContext context)
Parameters
analyzer
IAnalyzer<TResult, TContext>The analyzer.
context
TContextThe context.
Returns
- TResult
The analysis result.
Type Parameters
TResult
The type of the result.
TContext
The type of additional parameter for analyzer.
Clone(Variable?, IExpression?)
Clones this instance of the IExpression.
public IExpression Clone(Variable? key = null, IExpression? value = null)
Parameters
key
VariableThe left argument of new expression.
value
IExpressionThe right argument of new expression.
Returns
- IExpression
Returns the new instance of IExpression that is a clone of this instance.
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
obj
objectThe object to compare with the current object.
Returns
Execute()
Executes this expression. Don't use this method if your expression has variables or user-functions.
public object Execute()
Returns
- object
A result of the execution.
Exceptions
- NotSupportedException
The evaluation of this expression requires ExpressionParameters.
Execute(ExpressionParameters?)
Executes this expression.
public object Execute(ExpressionParameters? parameters)
Parameters
parameters
ExpressionParametersAn object that contains all parameters and functions for expressions.
Returns
- object
A result of the execution.
Exceptions
- ArgumentNullException
parameters
isnull
.
- See Also
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
ToString(IFormatter)
Returns a string that represents this instance.
public string ToString(IFormatter formatter)
Parameters
formatter
IFormatterThe formatter.