Click or drag to resize

TimeIntervalT Class

An interval defined by a start date and a stop date. The end points are optionally included in the interval.
Inheritance Hierarchy
SystemObject
  AGI.Foundation.TimeTimeIntervalT

Namespace:  AGI.Foundation.Time
Assembly:  AGI.Foundation.Core (in AGI.Foundation.Core.dll) Version: 24.1.418.0 (24.1.418.0)
Syntax
public sealed class TimeInterval<T> : IEquatable<TimeInterval<T>>, 
	IEquatableEpsilon<TimeInterval<T>>

Type Parameters

T
The type of the Data associated with the interval.

The TimeIntervalT type exposes the following members.

Constructors
  NameDescription
Public methodTimeIntervalT(JulianDate, JulianDate)
Initializes a new interval with the specified start date and stop date. The new interval is closed, meaning that both end points are included.
Public methodTimeIntervalT(JulianDate, JulianDate, T)
Initializes a new interval with the specified start date, stop date, and data. The new interval is closed, meaning that both end points are included.
Public methodTimeIntervalT(JulianDate, JulianDate, Boolean, Boolean)
Initializes a new interval with the specified start date and stop date. It is also specified whether or not the start and stop dates are included.
Public methodTimeIntervalT(JulianDate, JulianDate, T, Boolean, Boolean)
Initializes a new interval with the specified start date, stop date, and data. It is also specified whether or not the start and stop dates are included.
Top
Properties
  NameDescription
Public propertyStatic memberAcceptLeft
Public propertyStatic memberAcceptRight
Public propertyData
Gets the user-defined data associated with this interval.
Public propertyStatic memberEmpty
Gets an empty interval.
Public propertyIsEmpty
Gets a value indicating whether or not the interval is empty. Emptiness is defined as either the stop time comes before the start time, or the interval represents zero duration with exclusive endpoints. To probe if the amount of time contained in an interval is zero, convert to a duration using ToDuration and check for equality with Zero.
Public propertyIsStartIncluded
Gets a value indicating whether or not the Start date is included in the interval.
Public propertyIsStopIncluded
Gets a value indicating whether or not the Stop date is included in the interval.
Public propertyStart
Gets the start date of the interval.
Public propertyStop
Gets the stop date of the interval.
Top
Methods
  NameDescription
Public methodAdd(TimeIntervalT)
Adds two intervals together, producing an interval list that includes both intervals.
Public methodAdd(TimeIntervalCollectionT)
Adds an interval list to this interval, producing a new interval list that includes this interval plus all intervals in the input list. The input list is not changed by this method.
Public methodChangeDataTNew
Creates a new interval that is identical to this one except that it has a different value for the Data property.
Public methodContains
Determines if the interval contains a specified date.
Public methodEquals(Object)
Indicates whether another object is exactly equal to this instance.
(Overrides ObjectEquals(Object).)
Public methodEquals(TimeIntervalT)
Indicates whether another instance of this type is exactly equal to this instance.
Public methodEquals(TimeIntervalT, IEqualityComparerT)
Indicates whether another instance of this type is exactly equal to this instance.
Public methodEqualsEpsilon(TimeIntervalT, Double)
Determines if this time interval is equal to another time interval, using an epsilon to compare the Start and Stop properties of the two intervals. The dates are considered equal if they are within epsilon seconds of each other. All other properties must be identical.
Public methodEqualsEpsilon(TimeIntervalT, Double, IEqualityComparerT)
Determines if this time interval is equal to another time interval, using an epsilon to compare the Start and Stop properties of the two intervals. The dates are considered equal if they are within epsilon seconds of each other. All other properties must be identical.
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 methodGetHashCode(IEqualityComparerT)
Returns a hash code for this instance, which is suitable for use in hashing algorithms and data structures like a hash table.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIntersect(TimeInterval)
Computes an interval which is the intersection of this interval with another, with the data from this one.
Public methodIntersect(TimeIntervalT)
Computes an interval which is the intersection of this interval with another.
Public methodIntersect(TimeIntervalT, IEqualityComparerT)
Computes an interval which is the intersection of this interval with another.
Public methodIntersectMergingData
Computes an interval which is the intersection of this interval with another while also providing a means to merge the data of the two intervals.
Public methodRemoveData
Creates a new interval that is identical to this one except that it does not have a Data property.
Public methodToDuration
Returns a Duration representing the span of time between the Start and Stop of the interval.
Public methodToString
Returns a string with interval in the format "[Start, Stop) - Data". Square brackets indicate that the end point of the interval is included in the intervals. Parenthesis indicate that the end point is not included.
(Overrides ObjectToString.)
Public methodToTimeStandard
Returns a TimeIntervalT equivalent to this one where the time standard of the start and end dates has been converted to the specified 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
Fields
  NameDescription
Public fieldStatic memberDefaultComparer
A comparer for the Data property that considers two Data properties to be equal if Default reports that they are equal.
Top
See Also