Modifier and Type | Field and Description |
---|---|
static Coin |
Coin.DIME
A coin representing a Canadian dime.
|
static Coin |
Coin.LOONIE
A coin representing a Canadian $1 coin.
|
static Coin |
Coin.NICKEL
A coin representing a Canadian nickel.
|
static Coin |
Coin.PENNY
A coin representing a Canadian penny.
|
static Coin |
Coin.QUARTER
A coin representing a Canadian quarter.
|
static Coin |
Coin.TOONIE
A coin representing a Canadian $2 coin.
|
Modifier and Type | Method and Description |
---|---|
Coin |
OwnedPiggyBank.remove(Owner user,
Coin coin)
Allows the owner of this piggy bank to remove a coin equal to the value
of the specified coin from this piggy bank.
|
Modifier and Type | Method and Description |
---|---|
List<Coin> |
OwnedPiggyBank.deepCopy()
Returns a deep copy of the coins in this piggy bank.
|
List<Coin> |
OwnedPiggyBank.removeCoins(Owner user,
int value)
Allows the owner of this piggy bank to remove
the smallest number of coins whose total value in cents is equal
to the specified value in cents from this piggy bank.
|
Modifier and Type | Method and Description |
---|---|
int |
Coin.compareTo(Coin other)
Compares this coin to the specified coin.
|
boolean |
OwnedPiggyBank.contains(Coin coin)
Returns true if this piggy bank contains the specified coin, and false
otherwise.
|
int |
OwnedPiggyBank.numberOf(Coin coin)
Counts the number of coins equal to the specified coin
in this piggy bank.
|
Coin |
OwnedPiggyBank.remove(Owner user,
Coin coin)
Allows the owner of this piggy bank to remove a coin equal to the value
of the specified coin from this piggy bank.
|
Modifier and Type | Method and Description |
---|---|
void |
OwnedPiggyBank.add(List<Coin> coins)
Adds the specified coins to this piggy bank.
|
Constructor and Description |
---|
Coin(Coin c)
Initializes this coin to have the same value as the
specified coin.
|