Table of Contents

Class SpanGenerator

Namespace
Hegel.Temporal
Assembly
Hegel.dll

Draws calendar spans, shrinking toward the zero span. Every unit is drawn until one of the unit methods is called; from then on only the units given bounds are, and the others are zero. See Dates() for how bad arguments are reported.

public sealed class SpanGenerator : ValueGenerator<CalendarSpan>
Inheritance
SpanGenerator
Inherited Members

Methods

Days(long, long)

Draw days, between min and max.

public SpanGenerator Days(long min, long max)

Parameters

min long
max long

Returns

SpanGenerator

Exceptions

ArgumentException

The bounds are out of order, or conflict with the sign policy given.

DoDraw(TestCase)

Draw one value. Called inside a span labelled Label: draw from another generator through DrawSilent<T>(Generator<T>), which opens its span, rather than by calling its hook.

protected override CalendarSpan DoDraw(TestCase tc)

Parameters

tc TestCase

Returns

CalendarSpan

Hours(long, long)

Draw hours, between min and max.

public SpanGenerator Hours(long min, long max)

Parameters

min long
max long

Returns

SpanGenerator

Exceptions

ArgumentException

The bounds are out of order, or conflict with the sign policy given.

Microseconds(long, long)

Draw microseconds, between min and max.

public SpanGenerator Microseconds(long min, long max)

Parameters

min long
max long

Returns

SpanGenerator

Exceptions

ArgumentException

The bounds are out of order, or conflict with the sign policy given.

Milliseconds(long, long)

Draw milliseconds, between min and max.

public SpanGenerator Milliseconds(long min, long max)

Parameters

min long
max long

Returns

SpanGenerator

Exceptions

ArgumentException

The bounds are out of order, or conflict with the sign policy given.

Minutes(long, long)

Draw minutes, between min and max.

public SpanGenerator Minutes(long min, long max)

Parameters

min long
max long

Returns

SpanGenerator

Exceptions

ArgumentException

The bounds are out of order, or conflict with the sign policy given.

Months(long, long)

Draw months, between min and max.

public SpanGenerator Months(long min, long max)

Parameters

min long
max long

Returns

SpanGenerator

Exceptions

ArgumentException

The bounds are out of order, or conflict with the sign policy given.

Nanoseconds(long, long)

Draw nanoseconds, between min and max.

public SpanGenerator Nanoseconds(long min, long max)

Parameters

min long
max long

Returns

SpanGenerator

Exceptions

ArgumentException

The bounds are out of order, or conflict with the sign policy given.

Seconds(long, long)

Draw seconds, between min and max.

public SpanGenerator Seconds(long min, long max)

Parameters

min long
max long

Returns

SpanGenerator

Exceptions

ArgumentException

The bounds are out of order, or conflict with the sign policy given.

Sign(SpanSign)

How the units' signs are drawn: by default Uniform, one sign for the whole span. Unit bounds that the default policy does not admit (a unit that must be positive beside one that must be negative) are reported by the first draw, since a later call of this method could still allow them.

public SpanGenerator Sign(SpanSign sign)

Parameters

sign SpanSign

Returns

SpanGenerator

Exceptions

ArgumentException

sign is not a sign policy, or does not admit the unit bounds given.

Weeks(long, long)

Draw weeks, between min and max.

public SpanGenerator Weeks(long min, long max)

Parameters

min long
max long

Returns

SpanGenerator

Exceptions

ArgumentException

The bounds are out of order, or conflict with the sign policy given.

Years(long, long)

Draw years, between min and max.

public SpanGenerator Years(long min, long max)

Parameters

min long
max long

Returns

SpanGenerator

Exceptions

ArgumentException

The bounds are out of order, or conflict with the sign policy given.