Class DiscreteDistFloatScalar.Abs<T extends AbstractFloatScalarAbs<AU,T,RU,?>,AU extends AbsoluteLinearUnit<AU,RU>,RU extends Unit<RU>>
- java.lang.Object
-
- org.opentrafficsim.core.units.distributions.AbstractDiscreteDistScalar
-
- org.opentrafficsim.core.units.distributions.DiscreteDistFloatScalar.Abs<T,AU,RU>
-
- Type Parameters:
T- The absolute floatscalar typeAU- The absolute unit type usedRU- The relative unit type belonging to AU
- All Implemented Interfaces:
Serializable,Absolute
- Enclosing interface:
- DiscreteDistFloatScalar
public static class DiscreteDistFloatScalar.Abs<T extends AbstractFloatScalarAbs<AU,T,RU,?>,AU extends AbsoluteLinearUnit<AU,RU>,RU extends Unit<RU>> extends AbstractDiscreteDistScalar implements Absolute, Serializable
Absolute value.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Abs(int constant, AU unit)Construct a new DiscreteDistFloatScalar.Abs that always draws the same, fixed, value.Abs(DistDiscrete distribution, AU unit)Construct a new DiscreteDistFloatScalar.Abs.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tdraw()Draw a value from this DiscreteDistFloatScalar.Abs.StringtoString()-
Methods inherited from class org.opentrafficsim.core.units.distributions.AbstractDiscreteDistScalar
getDistribution, getUnit
-
-
-
-
Constructor Detail
-
Abs
public Abs(DistDiscrete distribution, AU unit)
Construct a new DiscreteDistFloatScalar.Abs.- Parameters:
distribution- DistDiscrete; the wrapped distribution function.unit- AU; the absolute unit.
-
Abs
public Abs(int constant, AU unit)Construct a new DiscreteDistFloatScalar.Abs that always draws the same, fixed, value.- Parameters:
constant- int; the constant value.unit- AU; the absolute unit.
-
-
Method Detail
-
draw
public final T draw()
Draw a value from this DiscreteDistFloatScalar.Abs.- Returns:
- T; a value drawn from the distribution in the given unit.
-
toString
public final String toString()
- Overrides:
toStringin classAbstractDiscreteDistScalar
-
-