Click or drag to resize

TimeIntervalCollectionTIntersectMergingData Method (TimeIntervalT, IEqualityComparerT, MergeTimeIntervalDataCallbackT)

Computes the intersection of this interval collection with an interval. When the interval overlaps an interval in the collection, a provided callback is used to merge the Data on each into a single value that is applied to the interval of intersection. If the mergeCallback is , intervals that overlap in time will not be included in the returned intersection collection if they have different data.

Namespace:  AGI.Foundation.Time
Assembly:  AGI.Foundation.Core (in AGI.Foundation.Core.dll) Version: 24.2.419.0 (24.2.419.0)
Syntax
public TimeIntervalCollection<T> IntersectMergingData(
	TimeInterval<T> interval,
	IEqualityComparer<T> dataComparer,
	MergeTimeIntervalDataCallback<T> mergeCallback
)

Parameters

interval
Type: AGI.Foundation.TimeTimeIntervalT
The interval to intersect with this collection
dataComparer
Type: System.Collections.GenericIEqualityComparerT
The object to use to compare the Data properties of intervals.
mergeCallback
Type: AGI.Foundation.TimeMergeTimeIntervalDataCallbackT
The method to use to "merge" the data on two intervals that intersect. If , the data from this interval will be used.

Return Value

Type: TimeIntervalCollectionT
The intersection of this collection with the interval.
Remarks
The returned collection will only contain the intervals that are in both collections. If two intervals in the two collections overlap but have different Data, the overlapping part will NOT be included in the resulting collection.
See Also