Table of Contents

Class HypocenterGroupKey

Namespace
Cryville.EEW.Report
Assembly
Cryville.EEW.dll
A group key based on hypocenter.
public record HypocenterGroupKey : ISortableReportGroupKey, IReportGroupKey, IEquatable<HypocenterGroupKey>
Inheritance
HypocenterGroupKey
Implements
Inherited Members

Constructors

HypocenterGroupKey(double, double, DateTime, double, double?)

A group key based on hypocenter.
public HypocenterGroupKey(double Latitude, double Longitude, DateTime DateTime, double Magnitude, double? Depth = null)

Parameters

Latitude double
The latitude of the hypocenter.
Longitude double
The longitude of the hypocenter.
DateTime DateTime
The origin date time in UTC.
Magnitude double
The magnitude.
Depth double?
The depth in kilometers.

Properties

DateTime

The origin date time in UTC.
public DateTime DateTime { get; init; }

Property Value

DateTime

Depth

The depth in kilometers.
public double? Depth { get; init; }

Property Value

double?

Latitude

The latitude of the hypocenter.
public double Latitude { get; init; }

Property Value

double

Longitude

The longitude of the hypocenter.
public double Longitude { get; init; }

Property Value

double

Magnitude

The magnitude.
public double Magnitude { get; init; }

Property Value

double

Methods

CompareTo(ISortableReportGroupKey)

Compares the group key with another group key and returns an integer that indicates whether the current group key precedes, follows, or occurs in the same position in the sort order as the other group key.
public int CompareTo(ISortableReportGroupKey obj)

Parameters

obj ISortableReportGroupKey
The other group key.

Returns

int
A value that indicates the relative order of the group keys being compared. Negative if the current group key precedes obj, zero if they occurs in the same position, or positive if the current group key follows obj.

Remarks

For any group key, among a list where all the group keys are sorted with this method, there must be at most one consecutive subsequence where all the groups keys pre-match with that group key, and all the other group keys in the list must not pre-match with that group key.

Match(ISortableReportGroupKey)

Matches against another group key.
public bool Match(ISortableReportGroupKey obj)

Parameters

obj ISortableReportGroupKey
The other group key.

Returns

bool
Whether the two group keys match.

Remarks

Report groups with any matching group keys are grouped together.

PreMatch(ISortableReportGroupKey)

Pre-matches against another group key.
public bool PreMatch(ISortableReportGroupKey obj)

Parameters

obj ISortableReportGroupKey
The other group key.

Returns

bool
Whether the two group keys pre-match, to potentially actually match.

Remarks

Implement this method so that it returns only based on the conditions used in CompareTo(ISortableReportGroupKey). For example, if CompareTo(ISortableReportGroupKey) only takes the event time into account, then implement this method so that it also only takes the event time into account, returns true if the two group keys potentially match, and returns false if they can never match.

Among a list where all the group keys are sorted with CompareTo(ISortableReportGroupKey), there must be at most one consecutive subsequence where all the groups keys pre-match with this group key, and all the other group keys in the list must not pre-match with this group key.