-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDatum.cs
More file actions
32 lines (27 loc) · 1 KB
/
Copy pathDatum.cs
File metadata and controls
32 lines (27 loc) · 1 KB
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
namespace JSONstat.Models;
/// <summary>
/// One observation: a value and, optionally, its status. Returned by the
/// <c>Data</c> navigation family. <see cref="Value"/> is <c>null</c> for
/// missing observations (a hole in the cube).
/// </summary>
public sealed class Datum
{
/// <summary>Creates a new observation.</summary>
public Datum(double? value, string? status)
{
Value = value;
Status = status;
}
/// <summary>The observation value, or <c>null</c> when missing.</summary>
public double? Value { get; }
/// <summary>The observation status, or <c>null</c> when none.</summary>
public string? Status { get; }
/// <summary>True when the observation is missing (<see cref="Value"/> is null).</summary>
public bool IsMissing => !Value.HasValue;
/// <summary>Deconstructs the observation into its value and status.</summary>
public void Deconstruct(out double? value, out string? status)
{
value = Value;
status = Status;
}
}