本文整理了Java中org.apache.commons.lang3.Range.<init>
方法的一些代码示例,展示了Range.<init>
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Range.<init>
方法的具体详情如下:
包路径:org.apache.commons.lang3.Range
类名称: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);
}
内容来源于网络,如有侵权,请联系作者删除!