Search Results for

    Show / Hide Table of Contents

    Class TimeInterval

    Represents a time interval with bounded/unbounded and inclusive/exclusive end points.

    Inheritance
    System.Object
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>
    TimeInterval
    Implements
    IInterval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>
    Inherited Members
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.LeftEndpoint
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.Left
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.RightEndpoint
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.Right
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.Span
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.IsFinite
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.IsOpen
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.IsClosed
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.IsDegenerate
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.IsEmpty
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.IsHalfBounded
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.IsNegative
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.Center
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.PointMinValue
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.PointMaxValue
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.SpanZeroValue
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.SpanMinValue
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.SpanMaxValue
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.PointIsWithin(DateTime)
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.Translate(TimeSpan)
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.Scale(TimeSpan, TimeSpan)
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.Scale(Single, Single)
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.ScaleLeft(TimeSpan)
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.ScaleLeft(Single)
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.ScaleCenter(TimeSpan)
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.ScaleCenter(Single)
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.ScaleRight(TimeSpan)
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.ScaleRight(Single)
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.IntersectsWith(IInterval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>)
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.IsDisjointFrom(IInterval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>)
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.IsSubsetOf(IInterval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>)
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.IsProperSubsetOf(IInterval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>)
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.Merge(IEnumerable<Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>>, Func<IntervalEndpoint<DateTime>, IntervalEndpoint<DateTime>, TimeInterval>)
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.Coverage(IEnumerable<Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>>, Func<IntervalEndpoint<DateTime>, IntervalEndpoint<DateTime>, TimeInterval>, Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>)
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.Intersection(IEnumerable<Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>>, Func<IntervalEndpoint<DateTime>, IntervalEndpoint<DateTime>, TimeInterval>, Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>)
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.ComparePoints(DateTime, DateTime)
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.ScaleSpan(TimeSpan, Double)
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.NegateSpan(TimeSpan)
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.TranslatePoint(DateTime, TimeSpan)
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.Difference(DateTime, DateTime)
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.Translate(TimeSpan, Func<DateTime, Boolean, Boolean, DateTime, Boolean, Boolean, TimeInterval>)
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.Scale(TimeSpan, TimeSpan, Func<DateTime, Boolean, Boolean, DateTime, Boolean, Boolean, TimeInterval>)
    Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>.Scale(Double, Double, Func<DateTime, Boolean, Boolean, DateTime, Boolean, Boolean, TimeInterval>)
    Namespace: Microsoft.Psi
    Assembly: Microsoft.Psi.dll
    Syntax
    public class TimeInterval : Interval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>, IInterval<DateTime, TimeSpan, IntervalEndpoint<DateTime>, TimeInterval>

    Constructors

    View Source

    TimeInterval(DateTime, DateTime)

    Initializes a new instance of the TimeInterval class.

    Declaration
    public TimeInterval(DateTime leftPoint, DateTime rightPoint)
    Parameters
    Type Name Description
    DateTime leftPoint

    Left bound point.

    DateTime rightPoint

    Right bound point.

    Remarks

    Defaults to inclusive.

    View Source

    TimeInterval(DateTime, RelativeTimeInterval)

    Initializes a new instance of the TimeInterval class.

    Declaration
    public TimeInterval(DateTime origin, RelativeTimeInterval relative)
    Parameters
    Type Name Description
    DateTime origin

    Origin around which interval is to be created.

    RelativeTimeInterval relative

    Time span interval specifying relative endpoints, bounding and inclusivity.

    View Source

    TimeInterval(DateTime, Boolean, DateTime, Boolean)

    Initializes a new instance of the TimeInterval class.

    Declaration
    public TimeInterval(DateTime leftPoint, bool leftInclusive, DateTime rightPoint, bool rightInclusive)
    Parameters
    Type Name Description
    DateTime leftPoint

    Left bound point.

    System.Boolean leftInclusive

    Whether left point is inclusive.

    DateTime rightPoint

    Right bound point.

    System.Boolean rightInclusive

    Whether right point is inclusive.

    View Source

    TimeInterval(DateTime, Boolean, Boolean, DateTime, Boolean, Boolean)

    Initializes a new instance of the TimeInterval class.

    Declaration
    public TimeInterval(DateTime leftPoint, bool leftInclusive, bool leftBounded, DateTime rightPoint, bool rightInclusive, bool rightBounded)
    Parameters
    Type Name Description
    DateTime leftPoint

    Left bound point (or min value if unbound).

    System.Boolean leftInclusive

    Whether left point is inclusive (always false if unbound).

    System.Boolean leftBounded

    Whether left point is bounded.

    DateTime rightPoint

    Right bound point (or min value if unbound).

    System.Boolean rightInclusive

    Whether right point is inclusive (always false if unbound).

    System.Boolean rightBounded

    Whether right point is bounded.

    View Source

    TimeInterval(IntervalEndpoint<DateTime>, IntervalEndpoint<DateTime>)

    Initializes a new instance of the TimeInterval class.

    Declaration
    public TimeInterval(IntervalEndpoint<DateTime> leftEndpoint, IntervalEndpoint<DateTime> rightEndpoint)
    Parameters
    Type Name Description
    IntervalEndpoint<DateTime> leftEndpoint

    Left endpoint.

    IntervalEndpoint<DateTime> rightEndpoint

    Right endpoint.

    Fields

    View Source

    Empty

    Canonical empty instance (bounded, non-inclusive, single point).

    Declaration
    public static readonly TimeInterval Empty
    Field Value
    Type Description
    TimeInterval
    View Source

    Infinite

    Canonical infinite interval (unbounded on both ends).

    Declaration
    public static readonly TimeInterval Infinite
    Field Value
    Type Description
    TimeInterval

    Properties

    View Source

    PointMaxValue

    Gets the point maximum value.

    Declaration
    protected override DateTime PointMaxValue { get; }
    Property Value
    Type Description
    DateTime
    Overrides
    Microsoft.Psi.Interval<DateTime, TimeSpan, Microsoft.Psi.IntervalEndpoint<DateTime>, Microsoft.Psi.TimeInterval>.PointMaxValue
    View Source

    PointMinValue

    Gets the point minimum value.

    Declaration
    protected override DateTime PointMinValue { get; }
    Property Value
    Type Description
    DateTime
    Overrides
    Microsoft.Psi.Interval<DateTime, TimeSpan, Microsoft.Psi.IntervalEndpoint<DateTime>, Microsoft.Psi.TimeInterval>.PointMinValue
    View Source

    SpanMaxValue

    Gets the span maximum value.

    Declaration
    protected override TimeSpan SpanMaxValue { get; }
    Property Value
    Type Description
    TimeSpan
    Overrides
    Microsoft.Psi.Interval<DateTime, TimeSpan, Microsoft.Psi.IntervalEndpoint<DateTime>, Microsoft.Psi.TimeInterval>.SpanMaxValue
    View Source

    SpanMinValue

    Gets the span minimum value.

    Declaration
    protected override TimeSpan SpanMinValue { get; }
    Property Value
    Type Description
    TimeSpan
    Overrides
    Microsoft.Psi.Interval<DateTime, TimeSpan, Microsoft.Psi.IntervalEndpoint<DateTime>, Microsoft.Psi.TimeInterval>.SpanMinValue
    View Source

    SpanZeroValue

    Gets the span zero value.

    Declaration
    protected override TimeSpan SpanZeroValue { get; }
    Property Value
    Type Description
    TimeSpan
    Overrides
    Microsoft.Psi.Interval<DateTime, TimeSpan, Microsoft.Psi.IntervalEndpoint<DateTime>, Microsoft.Psi.TimeInterval>.SpanZeroValue

    Methods

    View Source

    ComparePoints(DateTime, DateTime)

    Compare points.

    Declaration
    protected override int ComparePoints(DateTime a, DateTime b)
    Parameters
    Type Name Description
    DateTime a

    First point.

    DateTime b

    Second point.

    Returns
    Type Description
    System.Int32

    Less (-1), greater (+1) or equal (0).

    Overrides
    Microsoft.Psi.Interval<DateTime, TimeSpan, Microsoft.Psi.IntervalEndpoint<DateTime>, Microsoft.Psi.TimeInterval>.ComparePoints(DateTime, DateTime)
    View Source

    Coverage(IEnumerable<TimeInterval>)

    Determine coverage from minimum left to maximum right for a set of given intervals.

    Declaration
    public static TimeInterval Coverage(IEnumerable<TimeInterval> intervals)
    Parameters
    Type Name Description
    IEnumerable<TimeInterval> intervals

    The set of intervals.

    Returns
    Type Description
    TimeInterval

    Interval from minimum left to maximum right value.

    Remarks

    Returns empty interval when sequence is empty or contains only empty intervals.

    View Source

    Difference(DateTime, DateTime)

    Determine span between two given points.

    Declaration
    protected override TimeSpan Difference(DateTime x, DateTime y)
    Parameters
    Type Name Description
    DateTime x

    First point.

    DateTime y

    Second point.

    Returns
    Type Description
    TimeSpan

    Span between points.

    Overrides
    Microsoft.Psi.Interval<DateTime, TimeSpan, Microsoft.Psi.IntervalEndpoint<DateTime>, Microsoft.Psi.TimeInterval>.Difference(DateTime, DateTime)
    View Source

    Intersect(TimeInterval)

    Intersects with a specified time interval.

    Declaration
    public TimeInterval Intersect(TimeInterval timeInterval)
    Parameters
    Type Name Description
    TimeInterval timeInterval

    The time interval to intersect with.

    Returns
    Type Description
    TimeInterval

    The intersection time interval.

    View Source

    Intersection(IEnumerable<TimeInterval>)

    Determine intersection of a specified set of intervals.

    Declaration
    public static TimeInterval Intersection(IEnumerable<TimeInterval> intervals)
    Parameters
    Type Name Description
    IEnumerable<TimeInterval> intervals

    Set of intervals.

    Returns
    Type Description
    TimeInterval

    Intersection of the specified set of intervals.

    Remarks

    Returns empty when sequence is empty.

    View Source

    LeftBounded(DateTime)

    Constructor helper for left-bound instances.

    Declaration
    public static TimeInterval LeftBounded(DateTime left)
    Parameters
    Type Name Description
    DateTime left

    Left bound point.

    Returns
    Type Description
    TimeInterval

    A left-bound instance of the TimeInterval class.

    Remarks

    Defaults to inclusive.

    View Source

    LeftBounded(DateTime, Boolean)

    Constructor helper for left-bound instances.

    Declaration
    public static TimeInterval LeftBounded(DateTime left, bool inclusive)
    Parameters
    Type Name Description
    DateTime left

    Left bound point.

    System.Boolean inclusive

    Whether left point is inclusive.

    Returns
    Type Description
    TimeInterval

    A left-bound instance of the TimeInterval class.

    View Source

    Merge(IEnumerable<TimeInterval>)

    Merges a specified set of time intervals into a set of non-overlapping time intervals that cover the specified intervals.

    Declaration
    public static IEnumerable<TimeInterval> Merge(IEnumerable<TimeInterval> intervals)
    Parameters
    Type Name Description
    IEnumerable<TimeInterval> intervals

    A set of time intervals to cover.

    Returns
    Type Description
    IEnumerable<TimeInterval>

    Set of non-overlapping time intervals that cover the given time intervals.

    View Source

    NegateSpan(TimeSpan)

    Negate span.

    Declaration
    protected override TimeSpan NegateSpan(TimeSpan span)
    Parameters
    Type Name Description
    TimeSpan span

    Span to be negated.

    Returns
    Type Description
    TimeSpan

    Negated span.

    Overrides
    Microsoft.Psi.Interval<DateTime, TimeSpan, Microsoft.Psi.IntervalEndpoint<DateTime>, Microsoft.Psi.TimeInterval>.NegateSpan(TimeSpan)
    View Source

    RightBounded(DateTime)

    Constructor helper for right-bound instances.

    Declaration
    public static TimeInterval RightBounded(DateTime right)
    Parameters
    Type Name Description
    DateTime right

    Right bound point.

    Returns
    Type Description
    TimeInterval

    A right-bound instance of the TimeInterval class.

    Remarks

    Defaults to inclusive.

    View Source

    RightBounded(DateTime, Boolean)

    Constructor helper for right-bound instances.

    Declaration
    public static TimeInterval RightBounded(DateTime right, bool inclusive)
    Parameters
    Type Name Description
    DateTime right

    Right bound point.

    System.Boolean inclusive

    Whether right point is inclusive.

    Returns
    Type Description
    TimeInterval

    A right-bound instance of the TimeInterval class.

    View Source

    Scale(Single, Single)

    Scale endpoints by factors.

    Declaration
    public override TimeInterval Scale(float left, float right)
    Parameters
    Type Name Description
    System.Single left

    Factor by which to scale left.

    System.Single right

    Factor by which to scale right.

    Returns
    Type Description
    TimeInterval

    Scaled interval.

    Overrides
    Microsoft.Psi.Interval<DateTime, TimeSpan, Microsoft.Psi.IntervalEndpoint<DateTime>, Microsoft.Psi.TimeInterval>.Scale(System.Single, System.Single)
    View Source

    Scale(TimeSpan, TimeSpan)

    Scale endpoints by span distances.

    Declaration
    public override TimeInterval Scale(TimeSpan left, TimeSpan right)
    Parameters
    Type Name Description
    TimeSpan left

    Span by which to scale left.

    TimeSpan right

    Span by which to scale right.

    Returns
    Type Description
    TimeInterval

    Scaled interval.

    Overrides
    Microsoft.Psi.Interval<DateTime, TimeSpan, Microsoft.Psi.IntervalEndpoint<DateTime>, Microsoft.Psi.TimeInterval>.Scale(TimeSpan, TimeSpan)
    View Source

    ScaleSpan(TimeSpan, Double)

    Scale a span by a given factor.

    Declaration
    protected override TimeSpan ScaleSpan(TimeSpan span, double factor)
    Parameters
    Type Name Description
    TimeSpan span

    Span value.

    System.Double factor

    Factor by which to scale.

    Returns
    Type Description
    TimeSpan

    Scaled span.

    Overrides
    Microsoft.Psi.Interval<DateTime, TimeSpan, Microsoft.Psi.IntervalEndpoint<DateTime>, Microsoft.Psi.TimeInterval>.ScaleSpan(TimeSpan, System.Double)
    View Source

    Translate(TimeSpan)

    Translate by a span distance.

    Declaration
    public override TimeInterval Translate(TimeSpan span)
    Parameters
    Type Name Description
    TimeSpan span

    Span by which to translate.

    Returns
    Type Description
    TimeInterval

    Translated interval.

    Overrides
    Microsoft.Psi.Interval<DateTime, TimeSpan, Microsoft.Psi.IntervalEndpoint<DateTime>, Microsoft.Psi.TimeInterval>.Translate(TimeSpan)
    Remarks

    Unbound points do not change.

    View Source

    TranslatePoint(DateTime, TimeSpan)

    Translate point by given span.

    Declaration
    protected override DateTime TranslatePoint(DateTime point, TimeSpan span)
    Parameters
    Type Name Description
    DateTime point

    Point value.

    TimeSpan span

    Span by which to translate.

    Returns
    Type Description
    DateTime

    Translated point.

    Overrides
    Microsoft.Psi.Interval<DateTime, TimeSpan, Microsoft.Psi.IntervalEndpoint<DateTime>, Microsoft.Psi.TimeInterval>.TranslatePoint(DateTime, TimeSpan)

    Implements

    IInterval<TPoint, TSpan, TEndpoint, T>

    Extension Methods

    Serializer.DeepClone<T>(T, ref T)
    Serializer.DeepClone<T>(T, IRecyclingPool<T>)
    Serializer.DeepClone<T>(T)
    • View Source
    In This Article
    • Constructors
      • TimeInterval(DateTime, DateTime)
      • TimeInterval(DateTime, RelativeTimeInterval)
      • TimeInterval(DateTime, Boolean, DateTime, Boolean)
      • TimeInterval(DateTime, Boolean, Boolean, DateTime, Boolean, Boolean)
      • TimeInterval(IntervalEndpoint<DateTime>, IntervalEndpoint<DateTime>)
    • Fields
      • Empty
      • Infinite
    • Properties
      • PointMaxValue
      • PointMinValue
      • SpanMaxValue
      • SpanMinValue
      • SpanZeroValue
    • Methods
      • ComparePoints(DateTime, DateTime)
      • Coverage(IEnumerable<TimeInterval>)
      • Difference(DateTime, DateTime)
      • Intersect(TimeInterval)
      • Intersection(IEnumerable<TimeInterval>)
      • LeftBounded(DateTime)
      • LeftBounded(DateTime, Boolean)
      • Merge(IEnumerable<TimeInterval>)
      • NegateSpan(TimeSpan)
      • RightBounded(DateTime)
      • RightBounded(DateTime, Boolean)
      • Scale(Single, Single)
      • Scale(TimeSpan, TimeSpan)
      • ScaleSpan(TimeSpan, Double)
      • Translate(TimeSpan)
      • TranslatePoint(DateTime, TimeSpan)
    • Implements
    • Extension Methods
    Back to top Privacy & Cookies | Terms Of Use | Trademarks | © Microsoft
    Generated by DocFX