Class DifferentParametersExpression
- Namespace
- xFunc.Maths.Expressions
- Assembly
- xFunc.Maths.dll
The base class for expressions with different number of parameters.
public abstract class DifferentParametersExpression : IExpression
- Inheritance
-
DifferentParametersExpression
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
DifferentParametersExpression(IEnumerable<IExpression>)
Initializes a new instance of the DifferentParametersExpression class.
protected DifferentParametersExpression(IEnumerable<IExpression> arguments)
Parameters
argumentsIEnumerable<IExpression>The arguments.
DifferentParametersExpression(ImmutableArray<IExpression>)
Initializes a new instance of the DifferentParametersExpression class.
protected DifferentParametersExpression(ImmutableArray<IExpression> arguments)
Parameters
argumentsImmutableArray<IExpression>The arguments.
Exceptions
- ArgumentNullException
argumentsisnull.- ArgumentException
The amount of argument in the
argumentscollection is less thanMinParametersCountor greater thanMaxParametersCount.
Properties
Arguments
Gets the arguments.
public ImmutableArray<IExpression> Arguments { get; }
Property Value
this[int]
Gets or sets the IExpression at the specified index.
public IExpression this[int index] { get; }
Parameters
indexintThe index.
Property Value
- IExpression
The IExpression.
MaxParametersCount
Gets the maximum count of parameters. null - Infinity.
public abstract int? MaxParametersCount { get; }
Property Value
- int?
MinParametersCount
Gets the minimum count of parameters.
public abstract int? MinParametersCount { get; }
Property Value
- int?
ParametersCount
Gets the count of parameters.
public int ParametersCount { get; }
Property Value
Methods
AnalyzeInternal<TResult>(IAnalyzer<TResult>)
Analyzes the current expression.
protected abstract TResult AnalyzeInternal<TResult>(IAnalyzer<TResult> analyzer)
Parameters
analyzerIAnalyzer<TResult>The analyzer.
Returns
- TResult
The analysis result.
Type Parameters
TResultThe type of the result.
AnalyzeInternal<TResult, TContext>(IAnalyzer<TResult, TContext>, TContext)
Analyzes the current expression.
protected abstract TResult AnalyzeInternal<TResult, TContext>(IAnalyzer<TResult, TContext> analyzer, TContext context)
Parameters
analyzerIAnalyzer<TResult, TContext>The analyzer.
contextTContextThe context.
Returns
- TResult
The analysis result.
Type Parameters
TResultThe type of the result.
TContextThe type of additional parameter for analyzer.
Analyze<TResult>(IAnalyzer<TResult>)
Analyzes the current expression.
public TResult Analyze<TResult>(IAnalyzer<TResult> analyzer)
Parameters
analyzerIAnalyzer<TResult>The analyzer.
Returns
- TResult
The analysis result.
Type Parameters
TResultThe type of the result.
Exceptions
- ArgumentNullException
analyzerisnull.
Analyze<TResult, TContext>(IAnalyzer<TResult, TContext>, TContext)
Analyzes the current expression.
public TResult Analyze<TResult, TContext>(IAnalyzer<TResult, TContext> analyzer, TContext context)
Parameters
analyzerIAnalyzer<TResult, TContext>The analyzer.
contextTContextThe context.
Returns
- TResult
The analysis result.
Type Parameters
TResultThe type of the result.
TContextThe type of additional parameter for analyzer.
Exceptions
- ArgumentNullException
analyzerisnull.
Clone(ImmutableArray<IExpression>?)
Clones this instance of the IExpression.
public abstract IExpression Clone(ImmutableArray<IExpression>? arguments = null)
Parameters
argumentsImmutableArray<IExpression>?The list of arguments.
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
objobjectThe 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 virtual object Execute()
Returns
- object
A result of the execution.
Exceptions
- ExecutionException
The result of evaluation of arguments is not supported.
Execute(ExpressionParameters?)
Executes this expression.
public abstract object Execute(ExpressionParameters? parameters)
Parameters
parametersExpressionParametersAn object that contains all parameters and functions for expressions.
Returns
- object
A result of the execution.
Exceptions
- ExecutionException
The result of evaluation of arguments is not supported.
- 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
formatterIFormatterThe formatter.