Home NumberRangeSet Class
NumberRangeSet Class
Cancel

NumberRangeSet Class

Namespace: Json.Schema.DataGeneration

Inheritance: NumberRangeSet 🡒 object

Manages a collection of number ranges as a single entity.

Properties

NameTypeSummary
FullNumberRangeSetRepresents the full range of representable values.
NoneNumberRangeSetRepresent the empty set.
NonNegativeNumberRangeSetRepresents the range of 0 and all positive numbers.
RangesIReadOnlyList<NumberRange>Gets the ranges.

Constructors

NumberRangeSet(NumberRange range)

Creates a new set from a single range.

Declaration

1
public NumberRangeSet(NumberRange range)

NumberRangeSet(NumberRangeSet other)

Copies a range set.

Declaration

1
public NumberRangeSet(NumberRangeSet other)

NumberRangeSet(IEnumerable<NumberRange> other)

Creates a new set from a collection of ranges.

Declaration

1
public NumberRangeSet(IEnumerable<NumberRange> other)
ParameterTypeDescription
otherIEnumerable<NumberRange> 

Methods

Ceiling(Bound ceiling)

Applies a ceiling (upper bound).

Declaration

1
public NumberRangeSet Ceiling(Bound ceiling)

Returns

Floor(Bound floor)

Applies a floor (lower bound).

Declaration

1
public NumberRangeSet Floor(Bound floor)
ParameterTypeDescription
floorBound 

Returns

GetComplement()

Gets the complement, or inversion, of the set.

Declaration

1
public NumberRangeSet GetComplement()

Returns

Intersect(NumberRangeSet left, NumberRangeSet right)

Calculates the intersection of two sets.

Declaration

1
public static NumberRangeSet Intersect(NumberRangeSet left, NumberRangeSet right)

Returns

The resulting set of ranges that exist in both parameters.

Subtract(NumberRange range)

Calculates the set of one set omitting another.

Declaration

1
public NumberRangeSet Subtract(NumberRange range)
ParameterTypeDescription
rangeNumberRangeThe operating set.

Returns

The resulting set of ranges that exist in this set but not the operating set.

Subtract(NumberRangeSet left, NumberRangeSet right)

Calculates the set of one set omitting another.

Declaration

1
public static NumberRangeSet Subtract(NumberRangeSet left, NumberRangeSet right)
ParameterTypeDescription
leftNumberRangeSetThe source set.
rightNumberRangeSetThe operating set.

Returns

The resulting set of ranges that exist in the source set but not the operating set.

ToString()

Returns a string that represents the current object.

Declaration

1
public override string ToString()

Returns

A string that represents the current object.

Union(NumberRange range)

Calculates the union of two sets.

Declaration

1
public NumberRangeSet Union(NumberRange range)

Returns

The resulting set of ranges that exist in either parameters.

Union(NumberRangeSet left, NumberRangeSet right)

Calculates the union of two sets.

Declaration

1
public static NumberRangeSet Union(NumberRangeSet left, NumberRangeSet right)

Returns

The resulting set of ranges that exist in either parameters.

Contents