Range

Class of android.util · Range.java · Android's reference

public final class Range<T extends Comparable<? super T>>

An immutable range of comparable values, with both ends inclusive.

Constructors

public Range(T lower, T upper) source

Methods

public static <T extends Comparable<? super T>> Range<T> create(T lower, T upper) source
public T getLower() source
public T getUpper() source
public boolean contains(T value) source
public boolean contains(Range<T> range) source
public T clamp(T value) source
public Range<T> intersect(Range<T> range) source

The common part of the two ranges. They must overlap.

public Range<T> intersect(T lower, T upper) source
public Range<T> extend(Range<T> range) source

The smallest range that holds both ranges.

public Range<T> extend(T lower, T upper) source
public Range<T> extend(T value) source
public boolean equals(Object o) source
public int hashCode() source
public String toString() source

Made from ScarletNX's Sail at 166ad3910f80. The framework is ScarletNX's (GPL-3.0-or-later); the parts that follow the Android Open Source Project's sources (Apache-2.0) say so in their files.