Container for range definitions. More...
Public Member Functions | |
ValueRange (TValue min, TValue max) | |
Initialize a ValueRange object. More... | |
bool | Contains (TValue val) |
Check if a value is within the range. More... | |
bool | IntersectsWith (ValueRange< TValue > other) |
Check if this value range intersects with another value range. More... | |
override int | GetHashCode () |
Standard hashing function. More... | |
override bool | Equals (object obj) |
Equality check for ValueRange structures. More... | |
Static Public Member Functions | |
static bool | operator== (ValueRange< TValue > lhs, ValueRange< TValue > rhs) |
Equality check for two ValueRange structures. More... | |
static bool | operator!= (ValueRange< TValue > lhs, ValueRange< TValue > rhs) |
Inequality check for two ValueRange structures. More... | |
Properties | |
TValue | Min [get, set] |
Minimum value. More... | |
TValue | Max [get, set] |
Maximum value. More... | |
Container for range definitions.
TValue | type of value |
TValue | : | IComparable<TValue> |
ValueRange | ( | TValue | min, |
TValue | max | ||
) |
Initialize a ValueRange object.
min | minimum value |
max | maximum value |
bool Contains | ( | TValue | val | ) |
Check if a value is within the range.
val | Value to be checked |
override bool Equals | ( | object | obj | ) |
Equality check for ValueRange structures.
obj | object to compare to |
true
if this object and the object referred to by obj are identical, false otherwise.override int GetHashCode | ( | ) |
Standard hashing function.
bool IntersectsWith | ( | ValueRange< TValue > | other | ) |
Check if this value range intersects with another value range.
other | Object for intersection test. |
|
static |
Inequality check for two ValueRange structures.
lhs | left hand side |
rhs | right hand side |
true
if lhs and rhs are different, false
otherwise.
|
static |
Equality check for two ValueRange structures.
lhs | left hand side |
rhs | right hand side |
true
if lhs and rhs are identical, false
otherwise.
|
getset |
Maximum value.
ArgumentException | when trying to set a value that is lower than the currently set Min value |
|
getset |
Minimum value.
ArgumentException | when trying to set a value that exceeds the currently set Max value |