Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
CompoundOrder.cs
1using System;
2using System.Collections.Generic;
4
6{
10 public class CompoundOrder : IComparer<IElement>
11 {
12 private readonly IComparer<IElement>[] comparers;
13 private readonly int c;
14
19 public CompoundOrder(IComparer<IElement>[] Comparers)
20 {
21 this.comparers = Comparers;
22 this.c = Comparers.Length;
23 }
24
31 public int Compare(IElement x, IElement y)
32 {
33 int i, j;
34
35 for (i = 0; i < c; i++)
36 {
37 j = this.comparers[i].Compare(x, y);
38 if (j != 0)
39 return j;
40 }
41
42 return 0;
43 }
44 }
45}
Orders elements based on a sequence of comparers.
CompoundOrder(IComparer< IElement >[] Comparers)
Orders elements based on a sequence of comparers.
int Compare(IElement x, IElement y)
Compares two elements.
Basic interface for all types of elements.
Definition: IElement.cs:20