com.rubecula.jquantity
Class PresentableFactory

java.lang.Object
  extended bycom.rubecula.jquantity.PresentableFactory
All Implemented Interfaces:
PresentableFactoryInterface

public class PresentableFactory
extends java.lang.Object
implements PresentableFactoryInterface

Factory class for creating Presentables from double or long values (the preferred method of creating Presentables is to start with a String, create a Presentation using an implementer of PresentationFactoryInterface, and then turn that into a Presentable).

Since:
V_0_1
Version:
$Revision: 1.3 $
Author:
Robin Hillyard

Constructor Summary
PresentableFactory()
           
 
Method Summary
 Presentable createPresentable(double value, double bound)
          Method to create a new Approximation equivalent to the value provided.
 Presentable createPresentable(long value)
          Method to create a new Presentable equivalent to the value provided.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PresentableFactory

public PresentableFactory()
Method Detail

createPresentable

public Presentable createPresentable(long value)
                              throws PresentableException
Method to create a new Presentable equivalent to the value provided.

Specified by:
createPresentable in interface PresentableFactoryInterface
Parameters:
value - a long which represents the value to be created.
Returns:
the newly minted presentation.
Throws:
PresentableException - problem parsing the string given.

createPresentable

public Presentable createPresentable(double value,
                                     double bound)
                              throws PresentableException
Method to create a new Approximation equivalent to the value provided.

Specified by:
createPresentable in interface PresentableFactoryInterface
Parameters:
value - a double which represents the value to be created.
bound - the relative error bound of the value.
Returns:
the newly minted Approximation with the given value and error bound.
Throws:
PresentableException - problem parsing the string given.