Package org.apfloat.internal
Class FloatApfloatBuilder
java.lang.Object
org.apfloat.internal.FloatApfloatBuilder
- All Implemented Interfaces:
ApfloatBuilder
Builder class for building
ApfloatImpl implementations with the
float data element type.- Version:
- 1.0
- Author:
- Mikko Tommila
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateApfloat(double value, long precision, int radix) Create a newApfloatImplinstance from adouble.createApfloat(long value, long precision, int radix) Create a newApfloatImplinstance from along.createApfloat(PushbackReader in, long precision, int radix, boolean isInteger) Create a newApfloatImplinstance reading from a stream.createApfloat(String value, long precision, int radix, boolean isInteger) Create a newApfloatImplinstance from aString.
-
Constructor Details
-
FloatApfloatBuilder
public FloatApfloatBuilder()Default constructor.
-
-
Method Details
-
createApfloat
public ApfloatImpl createApfloat(String value, long precision, int radix, boolean isInteger) throws NumberFormatException, ApfloatRuntimeException Description copied from interface:ApfloatBuilderCreate a newApfloatImplinstance from aString.- Specified by:
createApfloatin interfaceApfloatBuilder- Parameters:
value- The string to be parsed to a number.precision- The precision of the number (in digits of the radix).radix- The radix in which the number is created.isInteger- Specifies if the number to be parsed from the string is to be treated as an integer or not.- Returns:
- A new
ApfloatImpl. - Throws:
NumberFormatException- If the number is not valid.ApfloatRuntimeException
-
createApfloat
public ApfloatImpl createApfloat(long value, long precision, int radix) throws NumberFormatException, ApfloatRuntimeException Description copied from interface:ApfloatBuilderCreate a newApfloatImplinstance from along.- Specified by:
createApfloatin interfaceApfloatBuilder- Parameters:
value- The value of the number.precision- The precision of the number (in digits of the radix).radix- The radix in which the number is created.- Returns:
- A new
ApfloatImpl. - Throws:
NumberFormatException- If the number is not valid.ApfloatRuntimeException
-
createApfloat
public ApfloatImpl createApfloat(double value, long precision, int radix) throws NumberFormatException, ApfloatRuntimeException Description copied from interface:ApfloatBuilderCreate a newApfloatImplinstance from adouble.- Specified by:
createApfloatin interfaceApfloatBuilder- Parameters:
value- The value of the number.precision- The precision of the number (in digits of the radix).radix- The radix in which the number is created.- Returns:
- A new
ApfloatImpl. - Throws:
NumberFormatException- If the number is not valid.ApfloatRuntimeException
-
createApfloat
public ApfloatImpl createApfloat(PushbackReader in, long precision, int radix, boolean isInteger) throws IOException, NumberFormatException, ApfloatRuntimeException Description copied from interface:ApfloatBuilderCreate a newApfloatImplinstance reading from a stream.- Specified by:
createApfloatin interfaceApfloatBuilder- Parameters:
in- The stream to read from.precision- The precision of the number (in digits of the radix).radix- The radix in which the number is created.isInteger- Specifies if the number to be parsed from the stream is to be treated as an integer or not.- Returns:
- A new
ApfloatImpl. - Throws:
IOException- If an I/O error occurs accessing the stream.NumberFormatException- If the number is not valid.ApfloatRuntimeException
-