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
key
stringThe name of parameter.
value
ParameterValueThe value of parameter.
type
ParameterTypeThe type of parameter.
Exceptions
- ArgumentNullException
The
key
isnull
or 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
other
ParameterAn 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 other
in the sort order.Zero This instance occurs in the same position in the sort order as other
.Greater than zero This instance follows other
in the sort order.
Constant(string, ParameterValue)
Creates a constant.
public static Parameter Constant(string key, ParameterValue value)
Parameters
key
stringThe name of parameter.
value
ParameterValueThe 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
obj
objectThe 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
other
ParameterAn 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
true
if theleft
parameter is equal to theright
parameter; 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
true
if theleft
parameter is greater than theright
parameter; 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
true
if theleft
parameter is greater than or equal to theright
parameter; 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
true
if theleft
parameter is not equal to theright
parameter; 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
true
if theleft
parameter is less than theright
parameter; 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
true
if theleft
parameter is less than or equal to theright
parameter; otherwise,false
.