TimeIntervalCollectionT Class 
Namespace: AGI.Foundation.Time
public sealed class TimeIntervalCollection<T> : IList<TimeInterval<T>>, ICollection<TimeInterval<T>>, IEnumerable<TimeInterval<T>>, IEnumerable, IList, ICollection, IEquatable<TimeIntervalCollection<T>>, IFreezable
The TimeIntervalCollectionT type exposes the following members.
Name  Description  

TimeIntervalCollectionT 
Initializes a new, empty interval collection.
 
TimeIntervalCollectionT(TimeIntervalT) 
Initializes a new instance from a single interval.
 
TimeIntervalCollectionT(TimeIntervalCollectionT) 
Initializes a new interval collection by copying an existing one.
 
TimeIntervalCollectionT(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.

Name  Description  

Count 
Gets the number of intervals in this interval collection.
 
Empty 
Gets an empty, readonly TimeIntervalCollectionT.
 
Infinite 
Gets an unbounded, infinite, readonly TimeIntervalCollectionT.
 
IsEmpty 
Gets a value indicating whether or not the interval collection is empty; where emptiness is defined as the count of intervals being equal to zero.
To probe if the amount of time contained in a collection is zero, convert to a duration using ToDuration and check for equality with Zero.
 
IsFrozen 
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.
 
IsInfinite 
Gets a value indicating whether or not the interval collection is infinite.
An infinite interval collection contains all possible times.
 
Item 
Gets the interval at the specified index.
 
Start 
Gets the start date of the first interval in the collection.
 
Stop 
Gets the stop date of the last interval in the collection

Name  Description  

Add(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.
 
Add(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.
 
Add(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.
 
Add(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.
 
Add(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.
 
Add(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.
 
AddMergingData(TimeIntervalT, MergeTimeIntervalDataCallbackT)  
AddMergingData(TimeIntervalCollectionT, MergeTimeIntervalDataCallbackT)  
Clear 
Removes all intervals from the interval collection.
 
Complement(JulianDate, JulianDate) 
Computes the complement of this time interval collection.
 
Complement(JulianDate, JulianDate, T) 
Computes the complement of this time interval collection.
 
Contains(JulianDate) 
Determines if the collection contains a specified date.
 
Contains(TimeIntervalT) 
Determines if this collection contains all of a specified interval.
 
ConvertDataTNew 
Converts this collection to a different kind of data without changing the intervals.
 
CopyTo 
Copies the intervals in this collection to an array.
 
Equals(Object) 
Indicates whether another object is exactly equal to this instance.
(Overrides ObjectEquals(Object).)  
Equals(TimeIntervalCollectionT) 
Indicates whether another instance of this type is exactly equal to this instance.
 
Equals(TimeIntervalCollectionT, IEqualityComparerT) 
Indicates whether another instance of this type is exactly equal to this instance.
 
EqualsEpsilon(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).
 
EqualsEpsilon(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).
 
FindIntervalContainingDate 
Finds the TimeInterval in this collection that contains a specified date.
 
Freeze 
Freezes this object. Further attempts to modify it will result
in an ObjectFrozenException.
 
GetEnumerator 
Gets an enumerator for this interval list.
 
GetHashCode 
Returns a hash code for this instance, which is suitable for use in hashing algorithms and data structures like a hash table.
(Overrides ObjectGetHashCode.)  
GetType  Gets the Type of the current instance. (Inherited from Object.)  
IndexOf(JulianDate) 
Finds the index of the TimeInterval in this collection
that contains the specified date.
 
IndexOf(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.
 
Intersect(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.
 
Intersect(TimeIntervalT) 
Computes the intersection of this interval collection with an interval.
 
Intersect(TimeIntervalCollection) 
Computes the intersection of this interval collection with another, returning data from this one.
 
Intersect(TimeIntervalCollectionT) 
Computes the intersection of this interval collection with another.
 
Intersect(TimeIntervalT, IEqualityComparerT) 
Computes the intersection of this interval collection with an interval.
 
Intersect(TimeIntervalCollectionT, IEqualityComparerT) 
Computes the intersection of this interval collection with another.
 
IntersectMergingData(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.
 
IntersectMergingData(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.
 
IntersectMergingData(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.
 
IntersectMergingData(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.
 
Remove(TimeInterval) 
Removes the specified interval from this interval list, creating a hole
over the specified interval.
 
Remove(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.
 
Remove(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.
 
RemoveAt 
Removes the interval at a specified index in the collection.
 
RemoveData 
Converts this collection to a TimeIntervalCollection by
removing the Data property from each interval.
 
RemoveLeavingEndpoints(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.
 
RemoveLeavingEndpoints(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.
 
RemoveLeavingEndpoints(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.
 
ToDuration 
Returns a Duration representing the span of time represented by the sum of the individual time intervals
in the collection.
 
ToString  Returns a string that represents the current object. (Overrides ObjectToString.)  
ToTimeStandard 
Converts all times in this time interval collection to be the specified time standard.

Name  Description  

Equality 
Returns if the two instances are exactly equal.
 
Inequality 
Returns if the two instances are not exactly equal.
