Package org.apfloat.internal
Class IntApfloatBuilder
- java.lang.Object
-
- org.apfloat.internal.IntApfloatBuilder
-
- All Implemented Interfaces:
ApfloatBuilder
public class IntApfloatBuilder extends java.lang.Object implements ApfloatBuilder
Builder class for buildingApfloatImpl
implementations with theint
data element type.- Version:
- 1.0
-
-
Constructor Summary
Constructors Constructor Description IntApfloatBuilder()
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ApfloatImpl
createApfloat(double value, long precision, int radix)
Create a newApfloatImpl
instance from adouble
.ApfloatImpl
createApfloat(long value, long precision, int radix)
Create a newApfloatImpl
instance from along
.ApfloatImpl
createApfloat(java.io.PushbackReader in, long precision, int radix, boolean isInteger)
Create a newApfloatImpl
instance reading from a stream.ApfloatImpl
createApfloat(java.lang.String value, long precision, int radix, boolean isInteger)
Create a newApfloatImpl
instance from aString
.
-
-
-
Method Detail
-
createApfloat
public ApfloatImpl createApfloat(java.lang.String value, long precision, int radix, boolean isInteger) throws java.lang.NumberFormatException, ApfloatRuntimeException
Description copied from interface:ApfloatBuilder
Create a newApfloatImpl
instance from aString
.- Specified by:
createApfloat
in 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:
java.lang.NumberFormatException
- If the number is not valid.ApfloatRuntimeException
-
createApfloat
public ApfloatImpl createApfloat(long value, long precision, int radix) throws java.lang.NumberFormatException, ApfloatRuntimeException
Description copied from interface:ApfloatBuilder
Create a newApfloatImpl
instance from along
.- Specified by:
createApfloat
in 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:
java.lang.NumberFormatException
- If the number is not valid.ApfloatRuntimeException
-
createApfloat
public ApfloatImpl createApfloat(double value, long precision, int radix) throws java.lang.NumberFormatException, ApfloatRuntimeException
Description copied from interface:ApfloatBuilder
Create a newApfloatImpl
instance from adouble
.- Specified by:
createApfloat
in 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:
java.lang.NumberFormatException
- If the number is not valid.ApfloatRuntimeException
-
createApfloat
public ApfloatImpl createApfloat(java.io.PushbackReader in, long precision, int radix, boolean isInteger) throws java.io.IOException, java.lang.NumberFormatException, ApfloatRuntimeException
Description copied from interface:ApfloatBuilder
Create a newApfloatImpl
instance reading from a stream.- Specified by:
createApfloat
in 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:
java.io.IOException
- If an I/O error occurs accessing the stream.java.lang.NumberFormatException
- If the number is not valid.ApfloatRuntimeException
-
-