Interface NumberHelper<N extends Number>
- All Superinterfaces:
Comparator<Number>
- All Known Implementing Classes:
BigDecimalHelper, BigIntegerHelper, DoubleHelper, FloatHelper, IntegerHelper, LongHelper, ShortHelper
A generic interface on top of a specific
Number implementation allowing to use it in a
generalized fashion.- Author:
- kimchy
-
Method Summary
Modifier and TypeMethodDescriptionAdds the two numbers (can be of any Number type) and returns the type result that the number helper handles.Casts the giveNumberinto the type the number helper handles.Divides the two numbers (can be of any Number type) and returns the type result that the number helper handles.Returns the maximum number for the specific type the number helper handles.Returns the minimum number for the specific type the number helper handles.Multiplies the two numbers (can be of any Number type) and returns the type result that the number helper handles.ONE()Returns the "ONE" value for the given type.Substracts the two numbers (can be of any Number type) and returns the type result that the number helper handles.ZERO()Returns the "ZERO" value for the given type.Methods inherited from interface Comparator
compare, equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Method Details
-
cast
-
MAX_VALUE
N MAX_VALUE()Returns the maximum number for the specific type the number helper handles. -
MIN_VALUE
N MIN_VALUE()Returns the minimum number for the specific type the number helper handles. -
ONE
N ONE()Returns the "ONE" value for the given type. -
ZERO
N ZERO()Returns the "ZERO" value for the given type. -
add
-
sub
-
mult
-
div
-