Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
IsEmpty.cs
1using System.Numerics;
2using System.Threading.Tasks;
6
8{
13 {
23 {
24 }
25
29 public override string FunctionName => nameof(IsEmpty);
30
34 public override string[] Aliases
35 {
36 get { return new string[] { "empty" }; }
37 }
38
46 {
47 object Value = Argument.AssociatedObjectValue;
48
49 if (Value is null)
50 return BooleanValue.True;
51 else if (Value is string s)
52 return this.EvaluateScalar(s, Variables);
53 else
54 return this.EvaluateScalar(Value.ToString(), Variables);
55 }
56
63 public override Task<IElement> EvaluateScalarAsync(IElement Argument, Variables Variables)
64 {
65 return Task.FromResult(this.EvaluateScalar(Argument, Variables));
66 }
67
75 {
76 if (string.IsNullOrEmpty(Argument))
77 return BooleanValue.True;
78 else
79 return BooleanValue.False;
80 }
81
89 {
90 return BooleanValue.False;
91 }
92
100 {
101 return BooleanValue.False;
102 }
103
111 {
112 return BooleanValue.False;
113 }
114
122 {
123 return BooleanValue.False;
124 }
125
133 {
134 return BooleanValue.False;
135 }
136 }
137}
Class managing a script expression.
Definition: Expression.cs:39
override IElement EvaluateScalar(Complex Argument, Variables Variables)
Evaluates the function on a scalar argument.
Definition: IsEmpty.cs:110
override IElement EvaluateScalar(double Argument, Variables Variables)
Evaluates the function on a scalar argument.
Definition: IsEmpty.cs:99
override IElement EvaluateScalar(string Argument, Variables Variables)
Evaluates the function on a scalar argument.
Definition: IsEmpty.cs:74
override IElement EvaluateScalar(Measurement Argument, Variables Variables)
Evaluates the function on a scalar argument.
Definition: IsEmpty.cs:132
override string[] Aliases
Optional aliases. If there are no aliases for the function, null is returned.
Definition: IsEmpty.cs:35
override IElement EvaluateScalar(bool Argument, Variables Variables)
Evaluates the function on a scalar argument.
Definition: IsEmpty.cs:88
override Task< IElement > EvaluateScalarAsync(IElement Argument, Variables Variables)
Evaluates the function on a scalar argument.
Definition: IsEmpty.cs:63
override IElement EvaluateScalar(IElement Argument, Variables Variables)
Evaluates the function on a scalar argument.
Definition: IsEmpty.cs:45
IsEmpty(ScriptNode Argument, int Start, int Length, Expression Expression)
IsEmpty(x)
Definition: IsEmpty.cs:21
override string FunctionName
Name of the function
Definition: IsEmpty.cs:29
override IElement EvaluateScalar(PhysicalQuantity Argument, Variables Variables)
Evaluates the function on a scalar argument.
Definition: IsEmpty.cs:121
Base class for funcions of one scalar variable.
ScriptNode Argument
Function argument.
Base class for all nodes in a parsed script tree.
Definition: ScriptNode.cs:69
int Start
Start position in script expression.
Definition: ScriptNode.cs:92
Boolean-valued number.
Definition: BooleanValue.cs:12
static readonly BooleanValue False
Constant false value.
static readonly BooleanValue True
Constant true value.
Collection of variables.
Definition: Variables.cs:25
Basic interface for all types of elements.
Definition: IElement.cs:20