Top Description Fields Constructors Methods
org.apache.commons.lang3

public Class NumberRange<N extends Number>

extends Range<N extends Number>
Class Inheritance
Known Direct Subclasses
org.apache.commons.lang3.DoubleRange, org.apache.commons.lang3.IntegerRange, org.apache.commons.lang3.LongRange
Type Parameters
<N>
The Number class.
Imports
java.util.Comparator

Specializes Range for Numbers.

We only offer specializations for Integer, Long, and Double (like Java Streams).

Since
3.13.0

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public
NumberRange(final N
the first element, not null
number1
,
final N
the second element, not null
number2
,
final Comparator<N>
the comparator to be used, null for natural ordering
comp
)

Creates an instance.

Method Summary

Inherited from org.apache.commons.lang3.Range:
betweenbetweencontainscontainsRangeelementCompareToequalsfitgetComparatorgetMaximumgetMinimumhashCodeintersectionWithisisisAfterisAfterRangeisBeforeisBeforeRangeisEndedByisNaturalOrderingisOverlappedByisStartedByofoftoStringtoString

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides org.apache.commons.lang3.Range.serialVersionUID.

Constructor Detail

NumberRangeback to summary
public NumberRange(final N number1, final N number2, final Comparator<N> comp)

Creates an instance.

Parameters
number1:N

the first element, not null

number2:N

the second element, not null

comp:Comparator<N>

the comparator to be used, null for natural ordering

Exceptions
NullPointerException:
  • when element1 is null.
  • when element2 is null.