Home NumberRange Struct
NumberRange Struct
Cancel

NumberRange Struct

Namespace: Json.Schema.DataGeneration

Inheritance: NumberRange 🡒 ValueType 🡒 object

Implemented interfaces:

  • IEquatable<NumberRange>

Defines a number range.

Properties

NameTypeSummary
MaximumBoundGets the maximum (upper bound).
MinimumBoundGets the minimum (lower bound).

Constructors

NumberRange(Bound minimum, Bound maximum)

Creates a new number range.

Declaration

1
public NumberRange(Bound minimum, Bound maximum)
ParameterTypeDescription
minimumBoundThe minimum
maximumBoundThe maximum

Methods

Contains(decimal value)

Calculates whether a single value is contained in the range.

Declaration

1
public bool Contains(decimal value)

Returns

True if the range contains the value; false otherwise.

Difference(NumberRange a, NumberRange b)

Calculates the set of one range omitting another. May be multiple ranges.

Declaration

1
public static IEnumerable<NumberRange> Difference(NumberRange a, NumberRange b)
ParameterTypeDescription
aNumberRangeThe source range
bNumberRangeThe operating range.

Returns

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

Equals(NumberRange other)

Indicates whether the current object is equal to another object of the same type.

Declaration

1
public bool Equals(NumberRange other)
ParameterTypeDescription
otherNumberRangeAn object to compare with this object.

Returns

true if the current object is equal to theother parameter; otherwise, false.

Equals(object obj)

Indicates whether this instance and a specified object are equal.

Declaration

1
public override bool Equals(object obj)
ParameterTypeDescription
objobjectThe object to compare with the current instance.

Returns

true ifobj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

Declaration

1
public override int GetHashCode()

Returns

A 32-bit signed integer that is the hash code for this instance.

Intersection(NumberRange a, NumberRange b)

Calculates the intersection of two number ranges. May be multiple ranges.

Declaration

1
public static IEnumerable<NumberRange> Intersection(NumberRange a, NumberRange b)

Returns

The resulting set of ranges that exist in both parameters.

ToString()

Returns the fully qualified type name of this instance.

Declaration

1
public override string ToString()

Returns

The fully qualified type name.

Union(NumberRange a, NumberRange b)

Calculates the union of two number ranges. May be multiple ranges.

Declaration

1
public static IEnumerable<NumberRange> Union(NumberRange a, NumberRange b)

Returns

The resulting set of ranges that exist in either parameters.

Contents