Package org.apache.commons.lang3
Class NumberRange<N extends java.lang.Number>
- java.lang.Object
-
- org.apache.commons.lang3.Range<N>
-
- org.apache.commons.lang3.NumberRange<N>
-
- Type Parameters:
N
- The Number class.
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
DoubleRange
,IntegerRange
,LongRange
public class NumberRange<N extends java.lang.Number> extends Range<N>
SpecializesRange
forNumber
s.We only offer specializations for Integer, Long, and Double (like Java Streams).
- Since:
- 3.13.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description NumberRange(N number1, N number2, java.util.Comparator<N> comp)
Creates an instance.
-
Method Summary
-
Methods inherited from class org.apache.commons.lang3.Range
between, between, contains, containsRange, elementCompareTo, equals, fit, getComparator, getMaximum, getMinimum, hashCode, intersectionWith, is, is, isAfter, isAfterRange, isBefore, isBeforeRange, isEndedBy, isNaturalOrdering, isOverlappedBy, isStartedBy, of, of, toString, toString
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
NumberRange
public NumberRange(N number1, N number2, java.util.Comparator<N> comp)
Creates an instance.- Parameters:
number1
- the first element, not nullnumber2
- the second element, not nullcomp
- the comparator to be used, null for natural ordering- Throws:
java.lang.NullPointerException
- when element1 is null.java.lang.NullPointerException
- when element2 is null.
-
-