Share via


Range.Clamp(Object) Method

Definition

Clamps value to this range.

[Android.Runtime.Register("clamp", "(Ljava/lang/Comparable;)Ljava/lang/Comparable;", "")]
public Java.Lang.Object? Clamp (Java.Lang.Object? value);
[<Android.Runtime.Register("clamp", "(Ljava/lang/Comparable;)Ljava/lang/Comparable;", "")>]
member this.Clamp : Java.Lang.Object -> Java.Lang.Object

Parameters

value
Object

a non-nullT reference

Returns

value clamped to this range.

Attributes

Remarks

Clamps value to this range.

If the value is within this range, it is returned. Otherwise, if it is < than the lower endpoint, the lower endpoint is returned, else the upper endpoint is returned. Comparisons are performed using the Comparable interface.

Java documentation for android.util.Range.clamp(T).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to