net.sf.jga.fn.arithmetic
Class ArithmeticFactory

java.lang.Object
  extended by net.sf.jga.fn.arithmetic.ArithmeticFactory

public class ArithmeticFactory
extends java.lang.Object

Builds and distributes implementations of the Arithmetic and IntegerArithmetic interfaces that are available for supported Number classes.

Copyright © 2003-2005 David A. Hall

Author:
David A. Hall

Constructor Summary
ArithmeticFactory()
           
 
Method Summary
static
<T extends java.lang.Number>
Arithmetic<T>
getArithmetic(java.lang.Class<T> c)
          Returns the Arithmetic implementation registered for the given class
static
<T extends java.lang.Number>
IntegerArithmetic<T>
getIntegralArithmetic(java.lang.Class<T> c)
          Returns the IntegerArithmetic implementation registered for the given class
static
<T extends java.lang.Number>
void
register(java.lang.Class<T> c, Arithmetic<T> math)
          Registers the Arithmetic implementation for the given class
static
<T extends java.lang.Number>
void
register(java.lang.Class<T> c, IntegerArithmetic<T> math)
          Registers the IntegerArithmetic implementation for the given class
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArithmeticFactory

public ArithmeticFactory()
Method Detail

register

public static <T extends java.lang.Number> void register(java.lang.Class<T> c,
                                                         Arithmetic<T> math)
Registers the Arithmetic implementation for the given class


register

public static <T extends java.lang.Number> void register(java.lang.Class<T> c,
                                                         IntegerArithmetic<T> math)
Registers the IntegerArithmetic implementation for the given class


getArithmetic

public static <T extends java.lang.Number> Arithmetic<T> getArithmetic(java.lang.Class<T> c)
Returns the Arithmetic implementation registered for the given class

Returns:
the Arithmetic implementation registered for the given class

getIntegralArithmetic

public static <T extends java.lang.Number> IntegerArithmetic<T> getIntegralArithmetic(java.lang.Class<T> c)
Returns the IntegerArithmetic implementation registered for the given class

Returns:
the IntegerArithmetic implementation registered for the given class


Copyright © 2002-2006 David A. Hall. All Rights Reserved.