GigaSpaces XAP 10.0.1 API

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

public interface NumberHelper<N extends Number>
extends Comparator<Number>

A generic interface on top of a specific Number implementation allowing to use it in a generalized fashion.

Author:
kimchy

Method Summary
 N add(Number lhs, Number rhs)
          Adds the two numbers (can be of any Number type) and returns the type result that the number helper handles.
 N cast(Number n)
          Casts the give Number into the type the number helper handles.
 N div(Number lhs, Number rhs)
          Divides the two numbers (can be of any Number type) and returns the type result that the number helper handles.
 N MAX_VALUE()
          Returns the maximum number for the specific type the number helper handles.
 N MIN_VALUE()
          Returns the minimum number for the specific type the number helper handles.
 N mult(Number lhs, Number rhs)
          Multiplies the two numbers (can be of any Number type) and returns the type result that the number helper handles.
 N ONE()
          Returns the "ONE" value for the given type.
 N sub(Number lhs, Number rhs)
          Substracts the two numbers (can be of any Number type) and returns the type result that the number helper handles.
 N ZERO()
          Returns the "ZERO" value for the given type.
 
Methods inherited from interface java.util.Comparator
compare, equals
 

Method Detail

cast

N cast(Number n)
Casts the give Number into 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

N add(Number lhs,
      Number rhs)
Adds the two numbers (can be of any Number type) and returns the type result that the number helper handles.


sub

N sub(Number lhs,
      Number rhs)
Substracts the two numbers (can be of any Number type) and returns the type result that the number helper handles.


mult

N mult(Number lhs,
       Number rhs)
Multiplies the two numbers (can be of any Number type) and returns the type result that the number helper handles.


div

N div(Number lhs,
      Number rhs)
Divides the two numbers (can be of any Number type) and returns the type result that the number helper handles.


GigaSpaces XAP 10.0.1 API

Copyright © GigaSpaces.