Class Bound<T>
- Namespace
- Arc4u
- Assembly
- Arc4u.dll
Represents a bound of an Interval<T>. This class cannot be inherited.
public sealed class Bound<T> : IEquatable<Bound<T>>, IComparable<Bound<T>>
Type Parameters
TThe Value type of the bound.
- Inheritance
-
Bound<T>
- Implements
-
IEquatable<Bound<T>>IComparable<Bound<T>>
- Inherited Members
Constructors
Bound(BoundType, BoundDirection, T)
Initializes a new instance of the Bound<T> class.
public Bound(BoundType type, BoundDirection direction, T value)
Parameters
typeBoundTypeThe bound type.
directionBoundDirectionThe bound direction.
valueTThe bound value.
Exceptions
- ArgumentException
An infinity bound must define an Direction.Opened direction.
Properties
Direction
Gets the bound direction.
public BoundDirection Direction { get; }
Property Value
Remarks
The set operation is not private to let the Silverlight runtime accessing the property during serializing/deserializing operations.
Type
Gets the bound type.
public BoundType Type { get; }
Property Value
Remarks
The set operation is not private to let the Silverlight runtime accessing the property during serializing/deserializing operations.
Value
Gets the bound value.
public T Value { get; }
Property Value
- T
Remarks
The set operation is not private to let the Silverlight runtime accessing the property during serializing/deserializing operations.
Methods
CompareTo(Bound<T>?)
Compares this instance to a specified Bound<T> and returns an indication of their relative values.
public int CompareTo(Bound<T>? other)
Parameters
Returns
- int
A signed number indicating the relative values of this instance and the
other.Value Type Condition Less than zero This instance is less than the other.Zero This instance is equal to the other.Greater than zero This instance is greater than the other.
Exceptions
- ArgumentNullException
otheris null.
Equals(Bound<T>?)
Returns a value indicating whether this instance is equal to a specified Bound<T>.
public bool Equals(Bound<T>? other)
Parameters
Returns
- bool
true if this instance equals the
other; otherwise, false.
Equals(object?)
Returns a value indicating whether this instance is equal to a specified object.
public override bool Equals(object? obj)
Parameters
objobjectAn object to compare to this instance.
Returns
- bool
true if this instance equals the
obj; otherwise, false.
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer hash code.
ToString()
Returns a string that represents this instance.
public override string ToString()
Returns
Remarks
Type of T is not considered for uniformity between types
and because it could result to non displayable string like with char type.
Operators
operator ==(Bound<T>, Bound<T>)
Implements the operator ==.
public static bool operator ==(Bound<T> left, Bound<T> right)
Parameters
Returns
- bool
The result of the operator.
operator >(Bound<T>, Bound<T>)
Implements the operator >.
public static bool operator >(Bound<T> left, Bound<T> right)
Parameters
Returns
- bool
The result of the operator.
Exceptions
- ArgumentNullException
leftorrightisnull.
operator >=(Bound<T>, Bound<T>)
Implements the operator >=.
public static bool operator >=(Bound<T> left, Bound<T> right)
Parameters
Returns
- bool
The result of the operator.
Exceptions
- ArgumentNullException
leftorrightisnull.
operator !=(Bound<T>, Bound<T>)
Implements the operator !=.
public static bool operator !=(Bound<T> left, Bound<T> right)
Parameters
Returns
- bool
The result of the operator.
operator <(Bound<T>, Bound<T>)
Implements the operator <.
public static bool operator <(Bound<T> left, Bound<T> right)
Parameters
Returns
- bool
The result of the operator.
Exceptions
- ArgumentNullException
leftorrightisnull.
operator <=(Bound<T>, Bound<T>)
Implements the operator <=.
public static bool operator <=(Bound<T> left, Bound<T> right)
Parameters
Returns
- bool
The result of the operator.
Exceptions
- ArgumentNullException
leftorrightisnull.