Class Parameter
- Namespace
- xFunc.Maths.Expressions.Parameters
- Assembly
- xFunc.Maths.dll
Represents the item of ExpressionParameters.
public class Parameter : IComparable<Parameter>, IEquatable<Parameter>
- Inheritance
-
Parameter
- Implements
- Inherited Members
Constructors
Parameter(string, ParameterValue, ParameterType)
Initializes a new instance of the Parameter class.
public Parameter(string key, ParameterValue value, ParameterType type = ParameterType.Normal)
Parameters
keystringThe name of parameter.
valueParameterValueThe value of parameter.
typeParameterTypeThe type of parameter.
Exceptions
- ArgumentNullException
The
keyisnullor empty.
Properties
Key
Gets the name of parameter.
public string Key { get; }
Property Value
Type
Gets the type of parameter.
public ParameterType Type { get; }
Property Value
Value
Gets or sets the value of parameter.
public ParameterValue Value { get; set; }
Property Value
Exceptions
- ParameterIsReadOnlyException
Thrown when the user tries to update read-only or constant parameter.
Methods
CompareTo(Parameter?)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
public int CompareTo(Parameter? other)
Parameters
otherParameterAn object to compare with this instance.
Returns
- int
A value that indicates the relative order of the objects being compared. The return value has these meanings:
Value Meaning Less than zero This instance precedes otherin the sort order.Zero This instance occurs in the same position in the sort order as other.Greater than zero This instance follows otherin the sort order.
Constant(string, ParameterValue)
Creates a constant.
public static Parameter Constant(string key, ParameterValue value)
Parameters
keystringThe name of parameter.
valueParameterValueThe value of parameter.
Returns
- Parameter
A constant.
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
Equals(Parameter?)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(Parameter? other)
Parameters
otherParameterAn object to compare with this object.
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
Operators
operator ==(Parameter?, Parameter?)
Indicates whether left parameter is equal to the right parameter.
public static bool operator ==(Parameter? left, Parameter? right)
Parameters
Returns
- bool
trueif theleftparameter is equal to therightparameter; otherwise,false.
operator >(Parameter?, Parameter?)
Indicates whether left parameter is greater than the right parameter.
public static bool operator >(Parameter? left, Parameter? right)
Parameters
Returns
- bool
trueif theleftparameter is greater than therightparameter; otherwise,false.
operator >=(Parameter?, Parameter?)
Indicates whether left parameter is greater than or equal to the right parameter.
public static bool operator >=(Parameter? left, Parameter? right)
Parameters
Returns
- bool
trueif theleftparameter is greater than or equal to therightparameter; otherwise,false.
operator !=(Parameter?, Parameter?)
Indicates whether left parameter is not equal to the right parameter.
public static bool operator !=(Parameter? left, Parameter? right)
Parameters
Returns
- bool
trueif theleftparameter is not equal to therightparameter; otherwise,false.
operator <(Parameter?, Parameter?)
Indicates whether left parameter is less than the right parameter.
public static bool operator <(Parameter? left, Parameter? right)
Parameters
Returns
- bool
trueif theleftparameter is less than therightparameter; otherwise,false.
operator <=(Parameter?, Parameter?)
Indicates whether left parameter is less than or equal to the right parameter.
public static bool operator <=(Parameter? left, Parameter? right)
Parameters
Returns
- bool
trueif theleftparameter is less than or equal to therightparameter; otherwise,false.