Package com.singularsys.jep.standard
Class DoubleNumberFactory
java.lang.Object
com.singularsys.jep.standard.DoubleNumberFactory
- All Implemented Interfaces:
JepComponent,NumberFactory,Serializable
Default class for creating number objects. This class can be replaced by
other NumberFactory implementations if other number types are required.
The results from the different methods can be inconsistent.
The createNumber(Number) method when passed an Integer
returns an Integer.
See StrictDoubleNumberFactory for a stricter
version where all methods return Double.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateNumber(boolean value) Create a number object with given boolean valuecreateNumber(double value) Creates a number object with given double value.createNumber(float value) Create a number object with given float valuecreateNumber(int value) Create a number object with given int valuecreateNumber(long value) Create a number object with given long valuecreateNumber(short value) Create a number object with given short valuecreateNumber(Complex value) Creates a number from a given complex value.createNumber(Number value) Creates a number object from a class implementing Number, May actually just return the class.createNumber(String value) Creates a Double object initialized to the value of the parameter.Gets a light-weight instance suitable for using in multiple threads.Return an object representing ZERO-ONE.getOne()Return an object representing ONE the multiplicative identity.getTwo()Return an object representing ONE+ONE.getZero()Return an object representing ZERO the additive identity.voidInitialize the component.
-
Field Details
-
ZERO
-
ONE
-
TWO
-
MINUSONE
-
-
Constructor Details
-
DoubleNumberFactory
public DoubleNumberFactory()
-
-
Method Details
-
createNumber
Creates a Double object initialized to the value of the parameter.- Specified by:
createNumberin interfaceNumberFactory- Parameters:
value- The initialization value for the returned object.
-
createNumber
Description copied from interface:NumberFactoryCreates a number object with given double value.- Specified by:
createNumberin interfaceNumberFactory
-
createNumber
Description copied from interface:NumberFactoryCreates a number object from a class implementing Number, May actually just return the class.- Specified by:
createNumberin interfaceNumberFactory
-
createNumber
Description copied from interface:NumberFactoryCreate a number object with given boolean value- Specified by:
createNumberin interfaceNumberFactory
-
createNumber
Description copied from interface:NumberFactoryCreate a number object with given float value- Specified by:
createNumberin interfaceNumberFactory
-
createNumber
Description copied from interface:NumberFactoryCreate a number object with given int value- Specified by:
createNumberin interfaceNumberFactory
-
createNumber
Description copied from interface:NumberFactoryCreate a number object with given short value- Specified by:
createNumberin interfaceNumberFactory
-
createNumber
Description copied from interface:NumberFactoryCreate a number object with given long value- Specified by:
createNumberin interfaceNumberFactory
-
createNumber
Description copied from interface:NumberFactoryCreates a number from a given complex value.- Specified by:
createNumberin interfaceNumberFactory- Throws:
ParseException
-
getMinusOne
Description copied from interface:NumberFactoryReturn an object representing ZERO-ONE.- Specified by:
getMinusOnein interfaceNumberFactory
-
getOne
Description copied from interface:NumberFactoryReturn an object representing ONE the multiplicative identity.- Specified by:
getOnein interfaceNumberFactory
-
getTwo
Description copied from interface:NumberFactoryReturn an object representing ONE+ONE.- Specified by:
getTwoin interfaceNumberFactory
-
getZero
Description copied from interface:NumberFactoryReturn an object representing ZERO the additive identity.- Specified by:
getZeroin interfaceNumberFactory
-
init
Description copied from interface:JepComponentInitialize the component. This method is called whenever a component is added to Jep. Hence, it allows components to keep track of the other components they may rely on.- Specified by:
initin interfaceJepComponent- Parameters:
jep- the current Jep instance
-
getLightWeightInstance
Description copied from interface:JepComponentGets a light-weight instance suitable for using in multiple threads.- Specified by:
getLightWeightInstancein interfaceJepComponent- Returns:
- either a new instance, null or 'this'.
-