ComparableScrewdriver<E extends Comparable> extension

provides extensions for Comparable

on
  • E

Methods

coerceAtLeast(E minimum) → E
Ensures that this value is not less than the specified minimum value. returns this value if it's greater than or equal to the minimum value or the minimum value otherwise.
coerceAtMost(E maximum) → E
Ensures that this value is not greater than the specified maximum value. Returns this value if it's less than or equal to the maximum value or the maximum value otherwise.
coerceIn(E min, E max) → E
Ensures that this value lies in the specified range min <--> max. Return this value if it's in the range, or min value if this value is less than min value, or max value if this value is greater than max value.

Operators

operator <(E other) bool
Returns true if other object is less than this.
operator <=(E other) bool
Returns true if other object is less than or equal to this.
operator >(E other) bool
Returns true if other object is greater than this.
operator >=(E other) bool
Returns true if other object is greater than or equal to this.