Class LongDoubleNumberFactory
- java.lang.Object
-
- com.singularsys.extensions.field.implementations.LongDoubleNumberFactory
-
- All Implemented Interfaces:
JepComponent,NumberFactory,java.io.Serializable
public class LongDoubleNumberFactory extends java.lang.Object implements NumberFactory
Where possible numbers are converted to Long otherwise Double. The test((long) val) == ((double) val)is used.- Author:
- Richard Morris
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LongDoubleNumberFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectcreateNumber(boolean value)Create a number object with given boolean valuejava.lang.ObjectcreateNumber(double value)Creates a number object with given double value.java.lang.ObjectcreateNumber(float value)Create a number object with given float valuejava.lang.ObjectcreateNumber(int value)Create a number object with given int valuejava.lang.ObjectcreateNumber(long value)Create a number object with given long valuejava.lang.ObjectcreateNumber(short value)Create a number object with given short valuejava.lang.ObjectcreateNumber(Complex value)Creates a number from a given complex value.java.lang.ObjectcreateNumber(java.lang.Number value)Creates a number object from a class implementing Number, May actually just return the class.java.lang.ObjectcreateNumber(java.lang.String value)Creates a number object and initializes its value.JepComponentgetLightWeightInstance()Gets a light-weight instance suitable for using in multiple threads.java.lang.ObjectgetMinusOne()Return an object representing ZERO-ONE.java.lang.ObjectgetOne()Return an object representing ONE the multiplicative identity.java.lang.ObjectgetTwo()Return an object representing ONE+ONE.java.lang.ObjectgetZero()Return an object representing ZERO the additive identity.voidinit(Jep jep)Initialize the component.
-
-
-
Method Detail
-
createNumber
public java.lang.Object createNumber(java.lang.String value) throws ParseExceptionDescription copied from interface:NumberFactoryCreates a number object and initializes its value.- Specified by:
createNumberin interfaceNumberFactory- Parameters:
value- The initial value of the number as a string.- Throws:
ParseException
-
createNumber
public java.lang.Object createNumber(double value) throws ParseExceptionDescription copied from interface:NumberFactoryCreates a number object with given double value.- Specified by:
createNumberin interfaceNumberFactory- Throws:
ParseException
-
createNumber
public java.lang.Object createNumber(int value) throws ParseExceptionDescription copied from interface:NumberFactoryCreate a number object with given int value- Specified by:
createNumberin interfaceNumberFactory- Throws:
ParseException
-
createNumber
public java.lang.Object createNumber(short value) throws ParseExceptionDescription copied from interface:NumberFactoryCreate a number object with given short value- Specified by:
createNumberin interfaceNumberFactory- Throws:
ParseException
-
createNumber
public java.lang.Object createNumber(long value) throws ParseExceptionDescription copied from interface:NumberFactoryCreate a number object with given long value- Specified by:
createNumberin interfaceNumberFactory- Throws:
ParseException
-
createNumber
public java.lang.Object createNumber(float value) throws ParseExceptionDescription copied from interface:NumberFactoryCreate a number object with given float value- Specified by:
createNumberin interfaceNumberFactory- Throws:
ParseException
-
createNumber
public java.lang.Object createNumber(boolean value) throws ParseExceptionDescription copied from interface:NumberFactoryCreate a number object with given boolean value- Specified by:
createNumberin interfaceNumberFactory- Throws:
ParseException
-
createNumber
public java.lang.Object createNumber(java.lang.Number value) throws ParseExceptionDescription copied from interface:NumberFactoryCreates a number object from a class implementing Number, May actually just return the class.- Specified by:
createNumberin interfaceNumberFactory- Throws:
ParseException
-
createNumber
public java.lang.Object createNumber(Complex value) throws ParseException
Description copied from interface:NumberFactoryCreates a number from a given complex value.- Specified by:
createNumberin interfaceNumberFactory- Throws:
ParseException
-
getMinusOne
public java.lang.Object getMinusOne()
Description copied from interface:NumberFactoryReturn an object representing ZERO-ONE.- Specified by:
getMinusOnein interfaceNumberFactory
-
getOne
public java.lang.Object getOne()
Description copied from interface:NumberFactoryReturn an object representing ONE the multiplicative identity.- Specified by:
getOnein interfaceNumberFactory
-
getTwo
public java.lang.Object getTwo()
Description copied from interface:NumberFactoryReturn an object representing ONE+ONE.- Specified by:
getTwoin interfaceNumberFactory
-
getZero
public java.lang.Object getZero()
Description copied from interface:NumberFactoryReturn an object representing ZERO the additive identity.- Specified by:
getZeroin interfaceNumberFactory
-
getLightWeightInstance
public JepComponent getLightWeightInstance()
Description copied from interface:JepComponentGets a light-weight instance suitable for using in multiple threads.- Specified by:
getLightWeightInstancein interfaceJepComponent- Returns:
- either an new instance, null or 'this'.
-
init
public void init(Jep jep)
Description copied from interface:JepComponentInitialize the component. This methods 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
-
-