PdfNumberRange Struct
Represents a range of numbers.
public readonly struct PdfNumberRange : IEquatable<PdfNumberRange>, IComparable<Double>
Public Structure PdfNumberRange
Implements IEquatable(Of PdfNumberRange), IComparable(Of Double)
Remarks
note
A range of numbers might be specified in the reversed order. In that case First is greater than Last. This is usually used when a PdfNumberRange is used to specify interpolation bounds of an interpolation that inverts a value. This is also the reason why properties First and Last are not named Min and Max (Min would be greater than Max, which is confusing).
Constructors
PdfNumberRange(Double, Double)
Initializes a new instance of the PdfNumberRange structure.
public PdfNumberRange(double first, double last)
Public Sub New(first As Double, last As Double)
Parameters
first
- System.Double
The first number of the new PdfNumberRange structure.
last
- System.Double
The last number of the new PdfNumberRange structure.
Exceptions
- System.ArgumentException
first
or last
is either System.Double.NaN, System.Double.NegativeInfinity or System.Double.PositiveInfinity.
Properties
First
Gets the first number in the range.
Property Value
- System.Double
The first number in the range.
Last
Gets the last number in the range.
Property Value
- System.Double
The last number in the range.
Methods
CompareTo(Double)
Returns 0 if a specified System.Double is between the First and the Last, -1 if it is less than the First, or 1 if it is greater than the Last. This method is applicable only if the First is less than or equal to the Last.
public readonly int CompareTo(double other)
Public Function CompareTo(other As Double) As Integer
Parameters
other
- System.Double
A System.Double to compare.
Returns
- System.Int32
A signed number indicating the relative order of this instance and other
.
Equals(PdfNumberRange)
Determines whether the other
PdfNumberRange is equal to this PdfNumberRange instance.
public readonly bool Equals(PdfNumberRange other)
Public Function Equals(other As PdfNumberRange) As Boolean
Parameters
other
- PdfNumberRange
The other number range to compare with this number range instance.
Returns
- System.Boolean
true if the other
PdfNumberRange is equal to this PdfNumberRange instance; otherwise, false.
Equals(Object)
Determines whether the specified System.Object is equal to this PdfNumberRange instance.
public override readonly bool Equals(object obj)
Public Overrides Function Equals(obj As Object) As Boolean
Parameters
obj
- System.Object
The System.Object to compare with this number range instance.
Returns
- System.Boolean
true if the specified System.Object is a PdfNumberRange and is equal to this PdfNumberRange instance; otherwise, false.
Overrides
GetHashCode()
Returns a hash code for this PdfNumberRange instance.
Returns
- System.Int32
An integer value that specifies a hash value for this PdfNumberRange instance.
Overrides
ToString()
Returns a System.String that represents this PdfNumberRange instance.
Returns
- System.String
A System.String that represents this PdfNumberRange instance.
Overrides
Remarks
This method should be used primarily for debugging purposes and should be considered volatile (format of its return value might change in future versions).
Operators
Equality(PdfNumberRange, PdfNumberRange)
Determines whether first
and second
PdfNumberRanges are equal.
public static bool operator ==(PdfNumberRange first, PdfNumberRange second)
Public Shared Operator =(first As PdfNumberRange, second As PdfNumberRange) As Boolean
Parameters
first
- PdfNumberRange
The first number range.
second
- PdfNumberRange
The second number range.
Returns
- System.Boolean
true if first
and second
number ranges are equal; otherwise, false.
Inequality(PdfNumberRange, PdfNumberRange)
Determines whether first
and second
PdfNumberRanges are not equal.
public static bool operator !=(PdfNumberRange first, PdfNumberRange second)
Public Shared Operator <>(first As PdfNumberRange, second As PdfNumberRange) As Boolean
Parameters
first
- PdfNumberRange
The first number range.
second
- PdfNumberRange
The second number range.
Returns
- System.Boolean
true if first
and second
number ranges are not equal; otherwise, false.