Click or drag to resize

TimeIntervalCollectionT Class

A collection of time intervals with data. The intervals are sorted by their start date and no two intervals in the list overlap each other.
Inheritance Hierarchy
SystemObject
  AGI.Foundation.TimeTimeIntervalCollectionT

Namespace:  AGI.Foundation.Time
Assembly:  AGI.Foundation.Core (in AGI.Foundation.Core.dll) Version: 24.2.419.0 (24.2.419.0)
Syntax
public sealed class TimeIntervalCollection<T> : IList<TimeInterval<T>>, 
	ICollection<TimeInterval<T>>, IEnumerable<TimeInterval<T>>, IEnumerable, 
	IList, ICollection, IEquatable<TimeIntervalCollection<T>>, IEquatableEpsilon<TimeIntervalCollection<T>>, 
	IFreezable

Type Parameters

T
The type of the Data associated with each interval.

The TimeIntervalCollectionT type exposes the following members.

Constructors
  NameDescription
Public methodTimeIntervalCollectionT
Initializes a new, empty interval collection.
Public methodTimeIntervalCollectionT(TimeIntervalT)
Initializes a new instance from a single interval.
Public methodTimeIntervalCollectionT(TimeIntervalCollectionT)
Initializes a new interval collection by copying an existing one.
Public methodTimeIntervalCollectionT(TimeIntervalCollection, T)
Initializes a new interval collection by copying an existing one that does not have data. The Data property of each interval in the new collection will be set to a specified value.
Top
Properties
  NameDescription
Public propertyCount
Gets the number of intervals in this interval collection.
Public propertyStatic memberEmpty
Gets an empty, read-only TimeIntervalCollectionT.
Public propertyStatic memberInfinite
Gets an unbounded, infinite, read-only TimeIntervalCollectionT.
Public propertyIsEmpty
Gets a value indicating whether this interval collection is empty, where emptiness is defined as the count of intervals being equal to zero. To determine if the amount of time contained in this interval collection is zero, convert to a duration using ToDuration and check for equality with Zero.
Public propertyIsFrozen
Gets a value indicating whether this object is frozen. A frozen object cannot be modified and an ObjectFrozenException will be thrown if an attempt is made to do so.
Public propertyIsInfinite
Gets a value indicating whether the interval collection is infinite. An infinite interval collection contains all possible times.
Public propertyItem
Gets the interval at the specified index.
Public propertyStart
Gets the start date of the first interval in the collection.
Public propertyStop
Gets the stop date of the last interval in the collection
Top
Methods
  NameDescription
Public methodAdd(TimeIntervalT)
Adds an interval to the interval collection. If the interval or a portion of the interval already exists in the collection, the Data from item will replace the data already in the collection.
Public methodAdd(TimeIntervalCollectionT)
Adds another interval collection to this interval collection. This interval collection will contain all intervals that were previously in either collection. If an interval or portion of an interval is in both containers and has different Data in each container, the data from collection takes precedence.
Public methodAdd(TimeIntervalT, IEqualityComparerT)
Adds an interval to the interval collection. If the interval or a portion of the interval already exists in the collection, the Data from item will replace the data already in the collection.
Public methodAdd(TimeIntervalCollection, T)
Adds another interval collection to this interval collection. This interval collection will contain all intervals that were previously in either collection. If an interval or portion of an interval is in both containers and has different Data in each container, the data from collection takes precedence.
Public methodAdd(TimeIntervalCollectionT, IEqualityComparerT)
Adds another interval collection to this interval collection. This interval collection will contain all intervals that were previously in either collection. If an interval or portion of an interval is in both containers and has different Data in each container, the data from collection takes precedence.
Public methodAdd(TimeIntervalCollection, T, IEqualityComparerT)
Adds another interval collection to this interval collection. This interval collection will contain all intervals that were previously in either collection. If an interval or portion of an interval is in both containers and has different Data in each container, the data from collection takes precedence.
Public methodAddMergingData(TimeIntervalT, MergeTimeIntervalDataCallbackT)
Adds an interval to the interval collection. The callback function specified will determine the instances of data occurring on any intersections by merging the existing Data on the interval in this collection with the Data on the interval to add.
Public methodAddMergingData(TimeIntervalCollectionT, MergeTimeIntervalDataCallbackT)
Adds a collection of intervals to this interval collection. The callback function specified will determine the instances of data occurring on any intersections by merging the existing Data on the interval in this collection with the Data on the interval to add.
Public methodClear
Removes all intervals from the interval collection.
Public methodComplement(JulianDate, JulianDate)
Computes the complement of this time interval collection.
Public methodComplement(JulianDate, JulianDate, T)
Computes the complement of this time interval collection.
Public methodContains(JulianDate)
Determines if the collection contains a specified date.
Public methodContains(TimeIntervalT)
Determines if this collection contains all of a specified interval.
Public methodConvertDataTNew
Converts this collection to a different kind of data without changing the intervals.
Public methodCopyTo
Copies the intervals in this collection to an array.
Public methodEquals(Object)
Indicates whether another object is exactly equal to this instance.
(Overrides ObjectEquals(Object).)
Public methodEquals(TimeIntervalCollectionT)
Indicates whether another instance of this type is exactly equal to this instance.
Public methodEquals(TimeIntervalCollectionT, IEqualityComparerT)
Indicates whether another instance of this type is exactly equal to this instance.
Public methodEqualsEpsilon(TimeIntervalCollectionT, Double)
Determines if this TimeIntervalCollection is equal to another by comparing each of the TimeInterval elements in the two collections with EqualsEpsilon(TimeInterval, Double).
Public methodEqualsEpsilon(TimeIntervalCollectionT, Double, IEqualityComparerT)
Determines if this TimeIntervalCollection is equal to another by comparing each of the TimeInterval elements in the two collections with EqualsEpsilon(TimeInterval, Double).
Public methodFindIntervalContainingDate
Finds the TimeInterval in this collection that contains a specified date.
Public methodFreeze
Freezes this object. Further attempts to modify this object will result in an ObjectFrozenException.
Public methodGetEnumerator
Gets an enumerator for this interval list.
Public methodGetHashCode
Returns a hash code for this instance, which is suitable for use in hashing algorithms and data structures like a hash table.
(Overrides ObjectGetHashCode.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIndexOf(JulianDate)
Finds the index of the TimeInterval in this collection that contains the specified date.
Public methodIndexOf(TimeIntervalT)
Finds the index of a given TimeIntervalT in the collection. This method requires that the given interval exactly match an interval in the collection. Intervals with different time standards, different data, or even slightly different values due to floating point noise will be considered to be different.
Public methodIntersect(TimeInterval)
Computes the intersection of this interval collection with an interval without data. The returned intervals will contain the data of the intervals in this collection which overlap with the specified interval.
Public methodIntersect(TimeIntervalT)
Computes the intersection of this interval collection with an interval.
Public methodIntersect(TimeIntervalCollection)
Computes the intersection of this interval collection with another, returning data from this one.
Public methodIntersect(TimeIntervalCollectionT)
Computes the intersection of this interval collection with another.
Public methodIntersect(TimeIntervalT, IEqualityComparerT)
Computes the intersection of this interval collection with an interval.
Public methodIntersect(TimeIntervalCollectionT, IEqualityComparerT)
Computes the intersection of this interval collection with another.
Public methodIntersectMergingData(TimeIntervalT, 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.
Public methodIntersectMergingData(TimeIntervalCollectionT, MergeTimeIntervalDataCallbackT)
Computes the intersection of this interval collection with another. When intervals in the two collections overlap, 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.
Public methodIntersectMergingData(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.
Public methodIntersectMergingData(TimeIntervalCollectionT, IEqualityComparerT, MergeTimeIntervalDataCallbackT)
Computes the intersection of this interval collection with another. When intervals in the two collections overlap, 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.
Public methodRemove(TimeInterval)
Removes the specified interval from this interval list, creating a hole over the specified interval.
Public methodRemove(TimeIntervalT)
Removes the specified interval from this interval list, creating a hole over the specified interval. The Data property of the input interval is ignored.
Public methodRemove(TimeIntervalCollectionT)
Removes the specified intervals from this interval list, creating a hole over the specified intervals. The Data property of the intervals in the input collection is ignored.
Public methodRemoveAt
Removes the interval at a specified index in the collection.
Public methodRemoveData
Converts this collection to a TimeIntervalCollection by removing the Data property from each interval.
Public methodRemoveLeavingEndpoints(TimeInterval)
Removes the specified interval from this interval list, creating a hole over the specified interval. The end points of the removed interval are NOT removed.
Public methodRemoveLeavingEndpoints(TimeIntervalT)
Removes the specified interval from this interval list, creating a hole over the specified interval. The end points of the removed interval are NOT removed. The Data property of the input interval is ignored.
Public methodRemoveLeavingEndpoints(TimeIntervalCollectionT)
Removes the specified intervals from this interval list, creating a hole over the specified intervals. The end points of the removed intervals are NOT removed. The Data property of the input interval is ignored.
Public methodToDuration
Returns a Duration representing the span of time represented by the sum of the individual time intervals in the collection.
Public methodToString
Returns a string that represents the current object.
(Overrides ObjectToString.)
Public methodToTimeStandard
Converts all times in this time interval collection to be the specified time standard.
Top
Operators
  NameDescription
Public operatorStatic memberEquality
Returns if the two instances are exactly equal.
Public operatorStatic memberInequality
Returns if the two instances are not exactly equal.
Top
See Also