com.jnape.palatable.lambda.functions.builtin.fn3

## Class Clamp<A extends Comparable<A>>

- java.lang.Object
- - com.jnape.palatable.lambda.functions.builtin.fn3.Clamp<A>

- Type Parameters:
    `A` - the bounds and input type
  All Implemented Interfaces:
    Fn1<A,Fn1<A,Fn1<A,A>>>, Fn2<A,A,Fn1<A,A>>, Fn3<A,A,A,A>, Applicative<Fn1<A,Fn1<A,A>>,Fn1<A,?>>, Cartesian<A,Fn1<A,Fn1<A,A>>,Fn1<?,?>>, Cocartesian<A,Fn1<A,Fn1<A,A>>,Fn1<?,?>>, Contravariant<A,Profunctor<?,Fn1<A,Fn1<A,A>>,Fn1<?,?>>>, Functor<Fn1<A,Fn1<A,A>>,Fn1<A,?>>, Profunctor<A,Fn1<A,Fn1<A,A>>,Fn1<?,?>>, Monad<Fn1<A,Fn1<A,A>>,Fn1<A,?>>, MonadReader<A,Fn1<A,Fn1<A,A>>,Fn1<A,?>>, MonadRec<Fn1<A,Fn1<A,A>>,Fn1<A,?>>, MonadWriter<A,Fn1<A,Fn1<A,A>>,Fn1<A,?>>

      public final class Clamp<A extends Comparable<A>>
      extends Object
      implements Fn3<A,A,A,A>

  Given two bounds and a value, "clamp" the value between the bounds via the following algorithm: - if the value is strictly less than the lower bound, return the lower bound - if the value is strictly greater than the upper bound, return the upper bound - otherwise, return the value

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `A` | `checkedApply(A lower, A upper, A a)`
    `static <A extends Comparable<A>> Clamp<A>` | `clamp()`
    `static <A extends Comparable<A>> Fn2<A,A,A>` | `clamp(A lower)`
    `static <A extends Comparable<A>> Fn1<A,A>` | `clamp(A lower, A upper)`
    `static <A extends Comparable<A>> A` | `clamp(A lower, A upper, A a)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.jnape.palatable.lambda.functions.Fn3

      `apply, apply, apply, checkedApply, compose, contraMap, diMapL, discardR, flip, fn3, fn3, fn3, uncurry, widen`

    - ### Methods inherited from interface com.jnape.palatable.lambda.functions.Fn2

      `checkedApply, curried, curry, fn2, fromBiFunction, toBiFunction`

    - ### Methods inherited from interface com.jnape.palatable.lambda.functions.Fn1

      `andThen, carry, cartesian, censor, choose, cocartesian, diMap, diMapR, discardL, flatMap, fmap, fn1, fromFunction, lazyZip, listens, local, pure, pureFn1, thunk, toFunction, trampolineM, zip, zip`

    - ### Methods inherited from interface com.jnape.palatable.lambda.monad.Monad

      `join`

    - ### Methods inherited from interface com.jnape.palatable.lambda.functor.Functor

      `coerce`

- - ### Method Detail

    - #### checkedApply

          public A checkedApply(A lower,
                                A upper,
                                A a)

      Specified by:
        `checkedApply` in interface `Fn3<A extends Comparable<A>,A extends Comparable<A>,A extends Comparable<A>,A extends Comparable<A>>`

    - #### clamp

          public static <A extends Comparable<A>> Clamp<A> clamp()

    - #### clamp

          public static <A extends Comparable<A>> Fn2<A,A,A> clamp(A lower)

    - #### clamp

          public static <A extends Comparable<A>> Fn1<A,A> clamp(A lower,
                                                                 A upper)

    - #### clamp

          public static <A extends Comparable<A>> A clamp(A lower,
                                                          A upper,
                                                          A a)