Package org.openspaces.core.util.numbers
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 java.util.Comparator
compare, equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Method Details
-
cast
Casts the giveNumberinto the type the number helper handles. -
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
Adds the two numbers (can be of any Number type) and returns the type result that the number helper handles. -
sub
Substracts the two numbers (can be of any Number type) and returns the type result that the number helper handles. -
mult
Multiplies the two numbers (can be of any Number type) and returns the type result that the number helper handles. -
div
Divides the two numbers (can be of any Number type) and returns the type result that the number helper handles.
-