Table of Contents

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

T

The Value type of the bound.

Inheritance
Bound<T>
Implements
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

type BoundType

The bound type.

direction BoundDirection

The bound direction.

value T

The 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

BoundDirection

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

BoundType

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

other Bound<T>

A Bound<T> to compare to this instance.

Returns

int

A signed number indicating the relative values of this instance and the other.

Value TypeCondition
Less than zeroThis instance is less than the other.
ZeroThis instance is equal to the other.
Greater than zeroThis instance is greater than the other.

Exceptions

ArgumentNullException

other is 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

other Bound<T>

A Bound<T> to compare to this instance.

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

obj object

An 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

string

A string that represents this instance.

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

left Bound<T>

The left Bound<T>.

right Bound<T>

The right Bound<T>.

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

left Bound<T>

The left Bound<T>.

right Bound<T>

The right Bound<T>.

Returns

bool

The result of the operator.

Exceptions

ArgumentNullException

left or right is null.

operator >=(Bound<T>, Bound<T>)

Implements the operator >=.

public static bool operator >=(Bound<T> left, Bound<T> right)

Parameters

left Bound<T>

The left Bound<T>.

right Bound<T>

The right Bound<T>.

Returns

bool

The result of the operator.

Exceptions

ArgumentNullException

left or right is null.

operator !=(Bound<T>, Bound<T>)

Implements the operator !=.

public static bool operator !=(Bound<T> left, Bound<T> right)

Parameters

left Bound<T>

The left Bound<T>.

right Bound<T>

The right Bound<T>.

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

left Bound<T>

The left Bound<T>.

right Bound<T>

The right Bound<T>.

Returns

bool

The result of the operator.

Exceptions

ArgumentNullException

left or right is null.

operator <=(Bound<T>, Bound<T>)

Implements the operator <=.

public static bool operator <=(Bound<T> left, Bound<T> right)

Parameters

left Bound<T>

The left Bound<T>.

right Bound<T>

The right Bound<T>.

Returns

bool

The result of the operator.

Exceptions

ArgumentNullException

left or right is null.