Class MathematicalExpression
The base-class for all mathematical expressions.
Inheritance
Implements
Inherited Members
Namespace: SuperOffice.Data.SQL
Assembly: SoDataBase.dll
Syntax
public abstract class MathematicalExpression : Argument, ICloneable
Constructors
MathematicalExpression(FieldDataType, int)
Initializes a new instance of the MathematicalExpression class, and takes datatype and length as in-parameters.
Declaration
public MathematicalExpression(FieldDataType dataType, int length)
Parameters
Type | Name | Description |
---|---|---|
FieldDataType | dataType | Type of the data. |
int | length | The length. |
MathematicalExpression(Argument, Argument)
Initializes a new instance of the MathematicalExpression class, and takes left and right as in-parameters.
Declaration
public MathematicalExpression(Argument left, Argument right)
Parameters
Type | Name | Description |
---|---|---|
Argument | left | The left-hand-side of the operation. |
Argument | right | The right-hand-side of the operation. |
Remarks
Will validate that the incoming parameters are not null.
MathematicalExpression(params Argument[])
Default constructor.
Declaration
public MathematicalExpression(params Argument[] arguments)
Parameters
Type | Name | Description |
---|---|---|
Argument[] | arguments |
Fields
_args
If Mathematical operation have several in-parameters,
an array of arguments is used to hold the parameters instead
of the left and right class-variables.
Declaration
protected Argument[] _args
Field Value
Type | Description |
---|---|
Argument[] |
Properties
Arguments
Get method for the argument collection.
Declaration
public Argument[] Arguments { get; }
Property Value
Type | Description |
---|---|
Argument[] |
Left
The left hand side of the operation.
Declaration
public Argument Left { get; set; }
Property Value
Type | Description |
---|---|
Argument |
Right
The right hand side of the operation.
Declaration
public Argument Right { get; set; }
Property Value
Type | Description |
---|---|
Argument |
Methods
GetMainField()
Information about a database field.
Declaration
public override FieldInfo GetMainField()
Returns
Type | Description |
---|---|
FieldInfo | Information about the database field |
Overrides
ToString()
String output.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | a MATHOP b |
Overrides
ValidateArgumentCollection()
Validates the class' argument-collection.
Declaration
protected virtual void ValidateArgumentCollection()
Remarks
The validation is common for Subtract, Multiply and Divide. Add needs to validate the collection itselves because of the functions possibility to do an add-operation on strings.
ValidateFieldInfoParameter(FieldInfo, Parameter)
ValidateFieldInfoParameter validates that the operation can be done on a FieldInfo and a Parameter.
Declaration
protected virtual void ValidateFieldInfoParameter(FieldInfo left, Parameter right)
Parameters
Type | Name | Description |
---|---|---|
FieldInfo | left | The left-hand-side of the operation. |
Parameter | right | The right-hand-side of the operation. |
Remarks
Validates that the Parameters is not 0 (zero).
ValidateParameterArgumentsForZeroValue(Parameter, Parameter)
ValidateParameterArguments validates that the operation can be done on two Parameters.
Declaration
protected virtual void ValidateParameterArgumentsForZeroValue(Parameter left, Parameter right)
Parameters
Type | Name | Description |
---|---|---|
Parameter | left | The left-hand-side of the operation. |
Parameter | right | The right-hand-side of the operation. |
Remarks
Validates that the value of both sides is not 0 (zero).