Package net.andreinc.mockneat.unit.types
Class Floats
- java.lang.Object
-
- net.andreinc.mockneat.abstraction.MockUnitBase
-
- net.andreinc.mockneat.unit.types.Floats
-
- All Implemented Interfaces:
MockUnit<java.lang.Float>,MockUnitFloat
public class Floats extends MockUnitBase implements MockUnitFloat
-
-
Field Summary
-
Fields inherited from class net.andreinc.mockneat.abstraction.MockUnitBase
mockNeat
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MockUnitFloatbound(float bound)Returns a newMockUnitFloatthat can be used to generate float values bounded by a specific value: [0,bound).static Floatsfloats()Returns aFloatsobject than can be used to generate random float numbers.MockUnitFloatfrom(float[] alphabet)Returns a newMockUnitFloatthat can be used generate float values from a given "alphabet".MockUnitFloatrange(float lowerBound, float upperBound)Returns a newMockUnitFloatthat can be used to generate random float values in a given range [lowerBound,upperBound).java.util.function.Supplier<java.lang.Float>supplier()This is the sole abstract method of the interface.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.andreinc.mockneat.abstraction.MockUnit
array, array, collection, collection, collection, collection, collection, collection, consume, consume, get, get, list, list, list, list, list, list, map, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapToDouble, mapToInt, mapToLocalDate, mapToLong, mapToString, mapToString, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, serialize, set, set, set, set, set, set, stream, val, val, valStr, valStr
-
Methods inherited from interface net.andreinc.mockneat.abstraction.MockUnitFloat
array, arrayPrimitive, doubleStream
-
-
-
-
Constructor Detail
-
Floats
protected Floats()
-
Floats
public Floats(MockNeat mockNeat)
-
-
Method Detail
-
floats
public static Floats floats()
Returns a
Floatsobject than can be used to generate random float numbers.Note: By default it generates float numbers in the [0.0f, 1.0f) range.
- Returns:
- A re-usable
Floatsobject. TheFloatsclass implementsMockUnitFloats.
-
supplier
public java.util.function.Supplier<java.lang.Float> supplier()
Description copied from interface:MockUnitThis is the sole abstract method of the interface. Needs to be implemented every-time a MockUnit is implemented.
-
range
public MockUnitFloat range(float lowerBound, float upperBound)
Returns a new
MockUnitFloatthat can be used to generate random float values in a given range [lowerBound,upperBound).- Parameters:
lowerBound- The upper bound of the interval.upperBound- The lower bound of the interval.- Returns:
- A new
MockUnitFloat.
-
bound
public MockUnitFloat bound(float bound)
Returns a new
MockUnitFloatthat can be used to generate float values bounded by a specific value: [0,bound).- Parameters:
bound- The float bound.- Returns:
- A new
MockUnitFloat.
-
from
public MockUnitFloat from(float[] alphabet)
Returns a new
MockUnitFloatthat can be used generate float values from a given "alphabet".- Parameters:
alphabet- An array of values from where the values are randomly picked.- Returns:
- A new
MockUnitFloat.
-
-