Class ProbabilityMassFunction.Mass<X>

  • Type Parameters:
    X - the type of the value
    Enclosing interface:
    ProbabilityMassFunction<X>

    public static final class ProbabilityMassFunction.Mass<X>
    extends Object
    Stores a possible outcome for a probability distribution and its associated probability.
    • Constructor Detail

      • Mass

        public Mass​(X outcome,
                    double probability)
        Creates an instance with an outcome and its associated probability.
        Parameters:
        outcome - an outcome
        probability - the probability that the given outcome will occur
    • Method Detail

      • outcome

        public X outcome()
        Gets the outcome.
        Returns:
        the outcome
      • probability

        public double probability()
        Gets the probability of the outcome.
        Returns:
        the probability