Package com.singularsys.jep
Interface NumberFactory
- All Superinterfaces:
JepComponent
,Serializable
- All Known Implementing Classes:
BigDecNumberFactory
,DoubleNumberFactory
This interface can be implemented to create numbers of any object type.
By implementing this interface and calling the setNumberFactory() method of
the Jep class, the constants in an expression will be created with that
class.
-
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 number object and initializes its value.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.Methods inherited from interface com.singularsys.jep.JepComponent
getLightWeightInstance, init
-
Method Details
-
createNumber
Creates a number object and initializes its value.- Parameters:
value
- The initial value of the number as a string.- Throws:
ParseException
-
createNumber
Creates a number object with given double value.- Throws:
ParseException
-
createNumber
Create a number object with given int value- Throws:
ParseException
-
createNumber
Create a number object with given short value- Throws:
ParseException
-
createNumber
Create a number object with given long value- Throws:
ParseException
-
createNumber
Create a number object with given float value- Throws:
ParseException
-
createNumber
Create a number object with given boolean value- Throws:
ParseException
-
createNumber
Creates a number object from a class implementing Number, May actually just return the class.- Throws:
ParseException
-
createNumber
Creates a number from a given complex value.- Throws:
ParseException
-
getZero
Object getZero()Return an object representing ZERO the additive identity. -
getOne
Object getOne()Return an object representing ONE the multiplicative identity. -
getMinusOne
Object getMinusOne()Return an object representing ZERO-ONE. -
getTwo
Object getTwo()Return an object representing ONE+ONE.
-