Functions: FnFloat

1. Overview

FnFloat is a function hub class containing a lot of static methods to work with Float objects. Those static methods return functions that take a Float object either as its input or output (depending on the function). It includes conversions to String, to an String representing a currency and logical operations between Float objects among others.

2. Functions

Function nameTypeParamsDescription
absFunction<Float, Float>

It returns the absolute value of the input

addFunction<Float, Float>Number add

It adds the given number to the target and returns the result

addFunction<Float, Float>byte add

It adds the given number to the target and returns the result

addFunction<Float, Float>short add

It adds the given number to the target and returns the result

addFunction<Float, Float>int add

It adds the given number to the target and returns the result

addFunction<Float, Float>long add

It adds the given number to the target and returns the result

addFunction<Float, Float>float add

It adds the given number to the target and returns the result

addFunction<Float, Float>double add

It adds the given number to the target and returns the result

avgFunction<Iterable<Float>, Float>

It returns the average of all the numbers in the Iterable input object

avgFunction<Iterable<Float>, Float>MathContext mathContext

It returns the average of all the numbers in the Iterable input object. The given MathContext will be used to round and set the output precision

avgFunction<Iterable<Float>, Float>RoundingMode roundingMode

It returns the average of all the numbers in the Iterable input object. The given RoundingMode will be used to round the output

avgArrayFunction<Float[], Float>

It returns the average of all the numbers in the input array

avgArrayFunction<Float[], Float>MathContext mathContext

It returns the average of all the numbers in the input array. The given MathContext will be used to round and set the output precision

avgArrayFunction<Float[], Float>RoundingMode roundingMode

It returns the average of all the numbers in the input array. The given RoundingMode will be used to round the output

betweenFunction<Float,Boolean>Number min
Number max

Determines whether the target object is between min and max in value, this is, whether target.compareTo(min) >= 0 && target.compareTo(max) <= 0. The target and the specified min and max have to implement Comparable.

betweenFunction<Float,Boolean>float min
float max

Determines whether the target object is between min and max in value, this is, whether target.compareTo(min) >= 0 && target.compareTo(max) <= 0. The target and the specified min and max have to implement Comparable.

divideByFunction<Float, Float>Number divisor

It divides the target element by the given divisor and returns its result

divideByFunction<Float, Float>byte divisor

It divides the target element by the given divisor and returns its result

divideByFunction<Float, Float>short divisor

It divides the target element by the given divisor and returns its result

divideByFunction<Float, Float>int divisor

It divides the target element by the given divisor and returns its result

divideByFunction<Float, Float>long divisor

It divides the target element by the given divisor and returns its result

divideByFunction<Float, Float>float divisor

It divides the target element by the given divisor and returns its result

divideByFunction<Float, Float>double divisor

It divides the target element by the given divisor and returns its result

divideByFunction<Float, Float>Number divisor
MathContext mathContext

It divides the target element by the given divisor and returns its result with the precision and rounding mode specified by mathContext

divideByFunction<Float, Float>byte divisor
MathContext mathContext

It divides the target element by the given divisor and returns its result with the precision and rounding mode specified by mathContext

divideByFunction<Float, Float>short divisor
MathContext mathContext

It divides the target element by the given divisor and returns its result with the precision and rounding mode specified by mathContext

divideByFunction<Float, Float>int divisor
MathContext mathContext

It divides the target element by the given divisor and returns its result with the precision and rounding mode specified by mathContext

divideByFunction<Float, Float>long divisor
MathContext mathContext

It divides the target element by the given divisor and returns its result with the precision and rounding mode specified by mathContext

divideByFunction<Float, Float>float divisor
MathContext mathContext

It divides the target element by the given divisor and returns its result with the precision and rounding mode specified by mathContext

divideByFunction<Float, Float>double divisor
MathContext mathContext

It divides the target element by the given divisor and returns its result with the precision and rounding mode specified by mathContext

divideByFunction<Float, Float>Number divisor
RoundingMode roundingMode

It divides the target element by the given divisor and returns its result rounded based on the specified rounding mode

divideByFunction<Float, Float>byte divisor
RoundingMode roundingMode

It divides the target element by the given divisor and returns its result rounded based on the specified rounding mode

divideByFunction<Float, Float>short divisor
RoundingMode roundingMode

It divides the target element by the given divisor and returns its result rounded based on the specified rounding mode

divideByFunction<Float, Float>int divisor
RoundingMode roundingMode

It divides the target element by the given divisor and returns its result rounded based on the specified rounding mode

divideByFunction<Float, Float>long divisor
RoundingMode roundingMode

It divides the target element by the given divisor and returns its result rounded based on the specified rounding mode

divideByFunction<Float, Float>float divisor
RoundingMode roundingMode

It divides the target element by the given divisor and returns its result rounded based on the specified rounding mode

divideByFunction<Float, Float>double divisor
RoundingMode roundingMode

It divides the target element by the given divisor and returns its result rounded based on the specified rounding mode

eqFunction<Float,Boolean>Float object

Determines whether the target object and the specified object are equal by calling the equals method on the target object.

eqFunction<Float,Boolean>float object

Determines whether the target object and the specified object are equal by calling the equals method on the target object.

eqByFunction<Float,Boolean>IFunction<Float,?> by
Object object

Determines whether the result of executing the specified function on the target object and the specified object parameter are equal by calling the equals method.

eqValueFunction<Float,Boolean>Number object

Determines whether the target object and the specified object are equal in value, this is, whether target.compareTo(object) == 0. Both the target and the specified object have to implement Comparable.

eqValueFunction<Float,Boolean>float object

Determines whether the target object and the specified object are equal in value, this is, whether target.compareTo(object) == 0. Both the target and the specified object have to implement Comparable.

eqValueByFunction<Float,Boolean>IFunction<Float,?> by
Object object

Determines whether the result of executing the specified function on the target object and the specified object parameter are equal in value, this is, whether functionResult.compareTo(object) == 0. Both the function result and the specified object have to implement Comparable.

greaterOrEqToFunction<Float,Boolean>Number object

Determines whether the target object is greater or equal to the specified object in value, this is, whether target.compareTo(object) >= 0. Both the target and the specified object have to implement Comparable.

greaterOrEqToFunction<Float,Boolean>float object

Determines whether the target object is greater or equal to the specified object in value, this is, whether target.compareTo(object) >= 0. Both the target and the specified object have to implement Comparable.

greaterOrEqToByFunction<Float,Boolean>IFunction<Float,?> by
Object object

Determines whether the result of executing the specified function on the target object is greater or equal to the specified object parameter in value, this is, whether functionResult.compareTo(object) >= 0. Both the target and the specified object have to implement Comparable.

greaterThanFunction<Float,Boolean>Number object

Determines whether the target object is greater than the specified object in value, this is, whether target.compareTo(object) > 0. Both the target and the specified object have to implement Comparable.

greaterThanFunction<Float,Boolean>float object

Determines whether the target object is greater than the specified object in value, this is, whether target.compareTo(object) > 0. Both the target and the specified object have to implement Comparable.

greaterThanByFunction<Float,Boolean>IFunction<Float,?> by
Object object

Determines whether the result of executing the specified function on the target object is greater than the specified object parameter in value, this is, whether functionResult.compareTo(object) > 0. Both the target and the specified object have to implement Comparable.

isNotNullFunction<Float,Boolean>

Determines whether the target object is null or not.

isNullFunction<Float,Boolean>

Determines whether the target object is null or not.

lessOrEqToFunction<Float,Boolean>Number object

Determines whether the target object is less or equal to the specified object in value, this is, whether target.compareTo(object) <= 0. Both the target and the specified object have to implement Comparable.

lessOrEqToFunction<Float,Boolean>float object

Determines whether the target object is less or equal to the specified object in value, this is, whether target.compareTo(object) <= 0. Both the target and the specified object have to implement Comparable.

lessOrEqToByFunction<Float,Boolean>IFunction<Float,?> by
Object object

Determines whether the result of executing the specified function on the target object is less or equal to the specified object parameter in value, this is, whether functionResult.compareTo(object) <= 0. Both the target and the specified object have to implement Comparable.

lessThanFunction<Float,Boolean>Number object

Determines whether the target object is less than the specified object in value, this is, whether target.compareTo(object) < 0. Both the target and the specified object have to implement Comparable.

lessThanFunction<Float,Boolean>float object

Determines whether the target object is less than the specified object in value, this is, whether target.compareTo(object) < 0. Both the target and the specified object have to implement Comparable.

lessThanByFunction<Float,Boolean>IFunction<Float,?> by
Object object

Determines whether the result of executing the specified function on the target object is less than the specified object parameter in value, this is, whether functionResult.compareTo(object) < 0. Both the target and the specified object have to implement Comparable.

maxFunction<Iterable<Float>, Float>

It returns the maximum number from an Iterable input object

maxArrayFunction<Float[], Float>

It returns the maximum number from the input array

minFunction<Iterable<Float>, Float>

It returns the minimum number from an Iterable input object

minArrayFunction<Float[], Float>

It returns the minimum number from the input array

multiplyByFunction<Float, Float>Number multiplicand

It multiplies target by multiplicand and returns its value

multiplyByFunction<Float, Float>byte multiplicand

It multiplies target by multiplicand and returns its value

multiplyByFunction<Float, Float>short multiplicand

It multiplies target by multiplicand and returns its value

multiplyByFunction<Float, Float>int multiplicand

It multiplies target by multiplicand and returns its value

multiplyByFunction<Float, Float>long multiplicand

It multiplies target by multiplicand and returns its value

multiplyByFunction<Float, Float>float multiplicand

It multiplies target by multiplicand and returns its value

multiplyByFunction<Float, Float>double multiplicand

It multiplies target by multiplicand and returns its value

multiplyByFunction<Float, Float>Number multiplicand
MathContext mathContext

It multiplies target by multiplicand and returns its value. The result precision and RoundingMode is specified by the given MathContext

multiplyByFunction<Float, Float>byte multiplicand
MathContext mathContext

It multiplies target by multiplicand and returns its value. The result precision and RoundingMode is specified by the given MathContext

multiplyByFunction<Float, Float>short multiplicand
MathContext mathContext

It multiplies target by multiplicand and returns its value. The result precision and RoundingMode is specified by the given MathContext

multiplyByFunction<Float, Float>int multiplicand
MathContext mathContext

It multiplies target by multiplicand and returns its value. The result precision and RoundingMode is specified by the given MathContext

multiplyByFunction<Float, Float>long multiplicand
MathContext mathContext

It multiplies target by multiplicand and returns its value. The result precision and RoundingMode is specified by the given MathContext

multiplyByFunction<Float, Float>float multiplicand
MathContext mathContext

It multiplies target by multiplicand and returns its value. The result precision and RoundingMode is specified by the given MathContext

multiplyByFunction<Float, Float>double multiplicand
MathContext mathContext

It multiplies target by multiplicand and returns its value. The result precision and RoundingMode is specified by the given MathContext

multiplyByFunction<Float, Float>Number multiplicand
RoundingMode roundingMode

It multiplies target by multiplicand and returns its value. The result is rounded based on the given RoundingMode

multiplyByFunction<Float, Float>byte multiplicand
RoundingMode roundingMode

It multiplies target by multiplicand and returns its value. The result is rounded based on the given RoundingMode

multiplyByFunction<Float, Float>short multiplicand
RoundingMode roundingMode

It multiplies target by multiplicand and returns its value. The result is rounded based on the given RoundingMode

multiplyByFunction<Float, Float>int multiplicand
RoundingMode roundingMode

It multiplies target by multiplicand and returns its value. The result is rounded based on the given RoundingMode

multiplyByFunction<Float, Float>long multiplicand
RoundingMode roundingMode

It multiplies target by multiplicand and returns its value. The result is rounded based on the given RoundingMode

multiplyByFunction<Float, Float>float multiplicand
RoundingMode roundingMode

It multiplies target by multiplicand and returns its value. The result is rounded based on the given RoundingMode

multiplyByFunction<Float, Float>double multiplicand
RoundingMode roundingMode

It multiplies target by multiplicand and returns its value. The result is rounded based on the given RoundingMode

notEqFunction<Float,Boolean>Float object

Determines whether the target object and the specified object are NOT equal by calling the equals method on the target object.

notEqFunction<Float,Boolean>float object

Determines whether the target object and the specified object are NOT equal by calling the equals method on the target object.

notEqByFunction<Float,Boolean>IFunction<Float,?> by
Object object

Determines whether the result of executing the specified function on the target object and the specified object parameter are NOT equal by calling the equals method.

notEqValueFunction<Float,Boolean>Number object

Determines whether the target object and the specified object are NOT equal in value, this is, whether target.compareTo(object) != 0. Both the target and the specified object have to implement Comparable.

notEqValueFunction<Float,Boolean>float object

Determines whether the target object and the specified object are NOT equal in value, this is, whether target.compareTo(object) != 0. Both the target and the specified object have to implement Comparable.

notEqValueByFunction<Float,Boolean>IFunction<Float,?> by
Object object

Determines whether the result of executing the specified function on the target object and the specified object parameter are NOT equal in value, this is, whether functionResult.compareTo(object) != 0. Both the function result and the specified object have to implement Comparable.

powFunction<Float, Float>int power

It performs the operation targetpower and returns its value

powFunction<Float, Float>int power
MathContext mathContext

It performs the operation targetpower and returns its value. The result precision and rounding mode is specified by the given MathContext

powFunction<Float, Float>int power
RoundingMode roundingMode

It performs the operation targetpower and returns its value. The result rounding mode is specified by the given RoundingMode

remainderFunction<Float, Float>Number divisor

It divides the target element by the given divisor and returns the remainder (target % divisor)

remainderFunction<Float, Float>byte divisor

It divides the target element by the given divisor and returns the remainder (target % divisor)

remainderFunction<Float, Float>short divisor

It divides the target element by the given divisor and returns the remainder (target % divisor)

remainderFunction<Float, Float>int divisor

It divides the target element by the given divisor and returns the remainder (target % divisor)

remainderFunction<Float, Float>long divisor

It divides the target element by the given divisor and returns the remainder (target % divisor)

remainderFunction<Float, Float>float divisor

It divides the target element by the given divisor and returns the remainder (target % divisor)

remainderFunction<Float, Float>double divisor

It divides the target element by the given divisor and returns the remainder (target % divisor)

subtractFunction<Float, Float>Number subtract

It subtracts the given number from the target and returns the result

subtractFunction<Float, Float>byte subtract

It subtracts the given number from the target and returns the result

subtractFunction<Float, Float>short subtract

It subtracts the given number from the target and returns the result

subtractFunction<Float, Float>int subtract

It subtracts the given number from the target and returns the result

subtractFunction<Float, Float>long subtract

It subtracts the given number from the target and returns the result

subtractFunction<Float, Float>float subtract

It subtracts the given number from the target and returns the result

subtractFunction<Float, Float>double subtract

It subtracts the given number from the target and returns the result

sumFunction<Iterable<Float>, Float>

It returns the sum of all the numbers in the Iterable input object

sumArrayFunction<Float[], Float>

It returns the sum of all the numbers in the input array

toCurrencyStrFunction<Float,String>

It returns the String representation of the target as a currency in the default Locale

toCurrencyStrFunction<Float,String>boolean groupingUsed

It returns the String representation of the target as a currency in the default Locale

toCurrencyStrFunction<Float,String>Locale locale

It returns the String representation of the target as a currency in the given Locale

toCurrencyStrFunction<Float,String>String locale

It returns the String representation of the target as a currency in the given locale

toCurrencyStrFunction<Float,String>Locale locale
boolean groupingUsed

It returns the String representation of the target as a currency in the given Locale

toCurrencyStrFunction<Float,String>String locale
boolean groupingUsed

It returns the String representation of the target as a currency in the given locale

toPercentStrFunction<Float,String>

A String representing a percentage is created from the target number.

toPercentStrFunction<Float,String>boolean groupingUsed

A String representing a percentage is created from the target number either using grouping or not depending on the given parameter. So,

toPercentStr(true) would return 100,000% if target number is 1000
toPercentStr(false) would return 100000% if target number is 1000
toPercentStrFunction<Float,String>Locale locale

A String representing a percentage is created from the target number in the given Locale

toPercentStrFunction<Float,String>String locale

A String representing a percentage is created from the target number in the given locale

toPercentStrFunction<Float,String>Locale locale
boolean groupingUsed

A String representing a percentage is created from the target number in the given Locale. Grouping will be used depending on the value of the groupingUsed parameter.

toPercentStrFunction<Float,String>String locale
boolean groupingUsed

A String representing a percentage is created from the target number in the given locale. Grouping will be used depending on the value of the groupingUsed parameter.

toStrFunction<Float,String>

It returns the String representation of the input number

toStrFunction<Float,String>boolean groupingUsed

It returns the String representation of the input number either using or not using grouping

toStrFunction<Float,String>Locale locale

It returns the String representation of the target number in the given Locale

toStrFunction<Float,String>String locale

It returns the String representation of the target number in the given locale

toStrFunction<Float,String>Locale locale
boolean groupingUsed

It returns the String representation of the target number in the given Locale. Grouping will be used depending on the value of the groupingUsed parameter

toStrFunction<Float,String>String locale
boolean groupingUsed

It returns the String representation of the target number in the given locale. Grouping will be used depending on the value of the groupingUsed parameter