Skip navigation links
B C D F G R T U V 

B

BagOfCoins - Class in <Unnamed>
This class describes a "bag" of coins: a collection of coins that "remembers" their flipping history.
BagOfCoins() - Constructor for class BagOfCoins
An empty constructor fills the bag with the default number of fair coins.
BagOfCoins(int) - Constructor for class BagOfCoins
A constructor with an integer argument customizes the number of fair coins.
BagOfCoins(double) - Constructor for class BagOfCoins
A constructor with a double argument customizes the bias of the coins.
BagOfCoins(int, double) - Constructor for class BagOfCoins
The fully customizable constructor takes both a number of coins and a bias.

C

Coin - Class in <Unnamed>
This class describes a flippable coin with adjustable bias.
Coin() - Constructor for class Coin
The default constructor produces a fair coin.
Coin(double) - Constructor for class Coin
This constructor accepts a bias parameter which influences the proportion of flips that will result in HEADS.
Coin.Flip - Enum in <Unnamed>
The enum or enumeration is a convenient way to define symbolic values that are discrete but are not necessarily numeric in value.

D

DEFAULT_COIN_COUNT - Static variable in class BagOfCoins
The default number of coins in the bag.

F

FAIR_BIAS - Static variable in class Coin
Constant values can be accomplished using Java’s `final` keyword.
flip() - Method in class Coin
The "money" method (no pun intended): this flips the coin and records and returns the result.

G

getBias() - Method in class Coin
Accessor method for revealing a coin's bias.
getCoin(int) - Method in class BagOfCoins
Returns the n-th coin in the bag.
getCoinCount() - Method in class BagOfCoins
Returns the number of coins in the bag.
getFlipCount() - Method in class Coin
Accessor method for revealing how many times a coin has been flipped since the last reset.
getFlipHistogram(int) - Method in class BagOfCoins
Returns a histogram with the given number of partitions, where each partition is an evenly- sized range within the total number of throws (e.g., 1000 throws divided into 10 partitions will gather up 0-99 heads, 100-199 heads, 200-299 heads, etc., up to 900-1000 heads [note the off-by-one size of that last partition]).
getFlipTotals() - Method in class BagOfCoins
Returns the heads and tails counts of the coins in the bag.
getHeadCount() - Method in class Coin
Accessor method for revealing how many times a coin flip has produced HEADS.
getTailCount() - Method in class Coin
Accessor method for revealing how many times a coin flip has produced TAILS.

R

reset() - Method in class Coin
Helper method that clears a coin's flip history.
resetCoins() - Method in class BagOfCoins
Resets the flipping records of all of the coins.

T

throwCoins() - Method in class BagOfCoins
Flips all of the coins in the bag once.

U

UNEVEN_PARTITION_MESSAGE - Static variable in class BagOfCoins
Standard message for when an invalid partition count is provided.

V

valueOf(String) - Static method in enum Coin.Flip
Returns the enum constant of this type with the specified name.
values() - Static method in enum Coin.Flip
Returns an array containing the constants of this enum type, in the order they are declared.
B C D F G R T U V 
Skip navigation links