org.apache.commons.lang3.Range.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(4.2k)|赞(0)|评价(0)|浏览(173)

本文整理了Java中org.apache.commons.lang3.Range.<init>方法的一些代码示例,展示了Range.<init>的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Range.<init>方法的具体详情如下:
包路径:org.apache.commons.lang3.Range
类名称:Range
方法名:<init>

Range.<init>介绍

[英]Creates an instance.
[中]创建一个实例。

代码示例

代码示例来源:origin: org.apache.commons/commons-lang3

/**
 * <p>Obtains a range with the specified minimum and maximum values (both inclusive).</p>
 *
 * <p>The range uses the specified {@code Comparator} to determine where
 * values lie in the range.</p>
 *
 * <p>The arguments may be passed in the order (min,max) or (max,min).
 * The getMinimum and getMaximum methods will return the correct values.</p>
 *
 * @param <T> the type of the elements in this range
 * @param fromInclusive  the first value that defines the edge of the range, inclusive
 * @param toInclusive  the second value that defines the edge of the range, inclusive
 * @param comparator  the comparator to be used, null for natural ordering
 * @return the range object, not null
 * @throws IllegalArgumentException if either element is null
 * @throws ClassCastException if using natural ordering and the elements are not {@code Comparable}
 */
public static <T> Range<T> between(final T fromInclusive, final T toInclusive, final Comparator<T> comparator) {
  return new Range<>(fromInclusive, toInclusive, comparator);
}

代码示例来源:origin: de.knightsoft-net/gwt-commons-lang3

/**
 * <p>Obtains a range with the specified minimum and maximum values (both inclusive).</p>
 *
 * <p>The range uses the specified {@code Comparator} to determine where
 * values lie in the range.</p>
 *
 * <p>The arguments may be passed in the order (min,max) or (max,min).
 * The getMinimum and getMaximum methods will return the correct values.</p>
 *
 * @param <T> the type of the elements in this range
 * @param fromInclusive  the first value that defines the edge of the range, inclusive
 * @param toInclusive  the second value that defines the edge of the range, inclusive
 * @param comparator  the comparator to be used, null for natural ordering
 * @return the range object, not null
 * @throws IllegalArgumentException if either element is null
 * @throws ClassCastException if using natural ordering and the elements are not {@code Comparable}
 */
public static <T> Range<T> between(final T fromInclusive, final T toInclusive, final Comparator<T> comparator) {
  return new Range<>(fromInclusive, toInclusive, comparator);
}

代码示例来源:origin: io.virtdata/virtdata-lib-curves4

/**
 * <p>Obtains a range with the specified minimum and maximum values (both inclusive).</p>
 *
 * <p>The range uses the specified {@code Comparator} to determine where
 * values lie in the range.</p>
 *
 * <p>The arguments may be passed in the order (min,max) or (max,min).
 * The getMinimum and getMaximum methods will return the correct values.</p>
 *
 * @param <T> the type of the elements in this range
 * @param fromInclusive  the first value that defines the edge of the range, inclusive
 * @param toInclusive  the second value that defines the edge of the range, inclusive
 * @param comparator  the comparator to be used, null for natural ordering
 * @return the range object, not null
 * @throws IllegalArgumentException if either element is null
 * @throws ClassCastException if using natural ordering and the elements are not {@code Comparable}
 */
public static <T> Range<T> between(final T fromInclusive, final T toInclusive, final Comparator<T> comparator) {
  return new Range<>(fromInclusive, toInclusive, comparator);
}

代码示例来源:origin: io.virtdata/virtdata-lib-realer

/**
 * <p>Obtains a range with the specified minimum and maximum values (both inclusive).</p>
 *
 * <p>The range uses the specified {@code Comparator} to determine where
 * values lie in the range.</p>
 *
 * <p>The arguments may be passed in the order (min,max) or (max,min).
 * The getMinimum and getMaximum methods will return the correct values.</p>
 *
 * @param <T> the type of the elements in this range
 * @param fromInclusive  the first value that defines the edge of the range, inclusive
 * @param toInclusive  the second value that defines the edge of the range, inclusive
 * @param comparator  the comparator to be used, null for natural ordering
 * @return the range object, not null
 * @throws IllegalArgumentException if either element is null
 * @throws ClassCastException if using natural ordering and the elements are not {@code Comparable}
 */
public static <T> Range<T> between(final T fromInclusive, final T toInclusive, final Comparator<T> comparator) {
  return new Range<>(fromInclusive, toInclusive, comparator);
}

相关文章