Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
StringValues.cs
3
5{
9 public sealed class StringValues : SemiGroup, IOrderedSet
10 {
11 private static readonly int hashCode = typeof(StringValues).FullName.GetHashCode();
12
16 public StringValues()
17 {
18 }
19
23 public static readonly StringValues Instance = new StringValues();
24
30 public override bool Contains(IElement Element)
31 {
32 return Element is StringValue S && !S.CaseInsensitive;
33 }
34
36 public override bool Equals(object obj)
37 {
38 return obj is StringValues;
39 }
40
42 public override int GetHashCode()
43 {
44 return hashCode;
45 }
46
53 public int Compare(IElement x, IElement y)
54 {
55 if (!(x.AssociatedObjectValue is string s1))
57
58 if (!(y.AssociatedObjectValue is string s2))
60
61 return string.Compare(s1, s2, false);
62 }
63 }
64}
Base class for all types of elements.
Definition: Element.cs:14
Base class for all types of semigroups.
Definition: SemiGroup.cs:10
Class managing a script expression.
Definition: Expression.cs:41
static string ToExpressionString(object Value)
Converts an object to a string, that can be parsed as part of an expression.
Definition: Expression.cs:5052
bool CaseInsensitive
If the string value is case insensitive or not.
Definition: StringValue.cs:56
Semi-group of string values.
Definition: StringValues.cs:10
override int GetHashCode()
Calculates a hash code of the element. Hash code.
Definition: StringValues.cs:42
StringValues()
Semi-group of string values.
Definition: StringValues.cs:16
static readonly StringValues Instance
Instance of the set of string values.
Definition: StringValues.cs:23
override bool Contains(IElement Element)
Checks if the set contains an element.
Definition: StringValues.cs:30
override bool Equals(object obj)
Compares the element to another. If elements are equal.
Definition: StringValues.cs:36
int Compare(IElement x, IElement y)
Compares two string values.
Definition: StringValues.cs:53
Basic interface for all types of elements.
Definition: IElement.cs:21
object AssociatedObjectValue
Associated object value.
Definition: IElement.cs:34
Basic interface for ordered sets.
Definition: IOrderedSet.cs:11