-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathNodeData.cs
35 lines (32 loc) · 1019 Bytes
/
NodeData.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using Genometric.GeUtilities.IGenomics;
using System;
namespace Genometric.MSPC.Core.IntervalTree
{
internal class NodeData<I> : IComparable<NodeData<I>>
where I : IPeak
{
public I Peak { get; }
public uint SampleID { get; }
public NodeData(I peak, uint sampleID)
{
Peak = peak;
SampleID = sampleID;
}
public int CompareTo(NodeData<I> other)
{
int c = Peak.CompareTo(other.Peak);
if (c != 0) return c;
c = SampleID.CompareTo(other.SampleID);
if (c != 0) return c;
/// At this point two NodeData are
/// exactly same and does not matter
/// which one proceedds the other,
/// hence return -1 or 1. However,
/// should not return 0, because
/// that would fail adding them to
/// the intervals list (two items
/// with same key).
return -1;
}
}
}