Show / Hide Table of Contents

Class WeightHandler<T>

A weight handler to provide add/subtract/multiply and comparison algorithms.

Inheritance
System.Object
WeightHandler<T>
DefaultWeightHandler
Namespace: System.Dynamic.ExpandoObject
Assembly: cs.temp.dll.dll
Syntax
public abstract class WeightHandler<T> : IComparer<T> where T : struct
Type Parameters
T

Properties

Infinity

Gets the weight that represents infinity.

Declaration
public abstract T Infinity { get; }
Property Value
T

Zero

Gets the weight that represents zero.

Declaration
public abstract T Zero { get; }
Property Value
T

Methods

Add(T, T)

Adds weight1 and weight2.

Declaration
public abstract T Add(T weight1, T weight2)
Parameters
T weight1

T weight2

Returns
T

Compare(T, T)

Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other.

Declaration
public abstract int Compare(T x, T y)
Parameters
T x

T y

Returns
System.Int32

Divide(T, Single)

Divides the given weight with the given divider.

Declaration
public abstract T Divide(T weight, float divider)
Parameters
T weight

System.Single divider

Returns
T

IsLargerThan(T, T)

Returns true if the given weight is larger than the other weight.

Declaration
public bool IsLargerThan(T weight, T other)
Parameters
T weight

T other

Returns
System.Boolean

IsLargerThanAny(T, T)

Returns true if the given weight is bigger in any of it's fields compared to the other weight.

Declaration
public abstract bool IsLargerThanAny(T weight, T other)
Parameters
T weight

T other

Returns
System.Boolean

IsLargerThanOrEqual(T, T)

Returns true if the given weight is larger than or equal to the other weight.

Declaration
public bool IsLargerThanOrEqual(T weight, T other)
Parameters
T weight

T other

Returns
System.Boolean

IsSmallerThan(T, T)

Returns true if the given weight is smaller than the other weight.

Declaration
public bool IsSmallerThan(T weight, T other)
Parameters
T weight

T other

Returns
System.Boolean

IsSmallerThanOrEqual(T, T)

Returns true if the given weight is smaller than or equal to the other weight.

Declaration
public bool IsSmallerThanOrEqual(T weight, T other)
Parameters
T weight

T other

Returns
System.Boolean

Multiply(T, Single)

Multiplies the given weight with the given factor.

Declaration
public abstract T Multiply(T weight, float factor)
Parameters
T weight

System.Single factor

Returns
T

Subtract(T, T)

Subtracts weight2 from weight1.

Declaration
public abstract T Subtract(T weight1, T weight2)
Parameters
T weight1

T weight2

Returns
T

Back to top Built by Itinero, MIT licensed.