compareElementTimeWithSeparateTime method Null safety

TimeComparisonResult compareElementTimeWithSeparateTime(
  1. int elementNrA,
  2. GpsTime timeB

Performs compareTime for the item in the positions elementNrA and some separate timeB that's presumably not in the list, then returns the result.

Children my override this method to implement more efficient or custom algorithms, for example if they support overlapping time or if they have a way to do quick time comparisons without doing full item retrieval.


TimeComparisonResult compareElementTimeWithSeparateTime(
    int elementNrA, GpsTime timeB) {
  final elemA = this[elementNrA];
  return compareTimeSpans(
      startA: elemA.time.secondsSinceEpoch,
      endA: elemA.endTime.secondsSinceEpoch,
      startB: timeB.secondsSinceEpoch,
      endB: timeB.secondsSinceEpoch);