Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
Step.cs
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace Waher.Runtime.Text
6{
11 public class Step<T>
12 {
13 private T[] symbols;
14 private readonly int index1;
15 private readonly int index2;
16 private readonly EditOperation operation;
17
26 {
27 this.symbols = Symbols;
28 this.index1 = Index1;
29 this.index2 = Index2;
30 this.operation = Operation;
31 }
32
36 public T[] Symbols
37 {
38 get => this.symbols;
39 set => this.symbols = value;
40 }
41
45 public int Index1 => this.index1;
46
50 public int Index2 => this.index2;
51
55 public EditOperation Operation => this.operation;
56
58 public override string ToString()
59 {
60 StringBuilder Result = new StringBuilder();
61
62 Result.Append(this.operation.ToString());
63 Result.Append(": ");
64
65 foreach (T Symbol in this.symbols)
66 Result.Append(Symbol.ToString());
67
68 return Result.ToString();
69 }
70 }
71}
Represents a sub-sequence of symbols.
Definition: Step.cs:12
int Index2
Index into the second sequence of symbols.
Definition: Step.cs:50
override string ToString()
Definition: Step.cs:58
EditOperation Operation
Edit operation being performed.
Definition: Step.cs:55
T[] Symbols
Sequence of symbols.
Definition: Step.cs:37
Step(T[] Symbols, int Index1, int Index2, EditOperation Operation)
Represents a sub-sequence of symbols.
Definition: Step.cs:25
int Index1
Index into the first sequence of symbols.
Definition: Step.cs:45
EditOperation
Type of edit-operation