Added JavaDocs to Coin/Fake classes.
This commit is contained in:
parent
abe66c0862
commit
5f37a3a97b
@ -82,16 +82,49 @@ public class FakeCoin extends Application {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This class is used to keep a list of Coins.
|
||||
*
|
||||
* @author Jonathan Turner
|
||||
* @version Spring 2024
|
||||
*/
|
||||
private static class Coin {
|
||||
|
||||
public int weight;
|
||||
public int location;
|
||||
|
||||
/**
|
||||
* Creates a new coin with a default weight and location.
|
||||
*
|
||||
* @precondition none
|
||||
* @postcondition a coin is created
|
||||
*
|
||||
* @param location the coins location
|
||||
*/
|
||||
public Coin(int location) {
|
||||
this.weight = 3;
|
||||
this.location = location;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This class is used to track the fake coin..
|
||||
*
|
||||
* @author Jonathan Turner
|
||||
* @version Spring 2024
|
||||
*/
|
||||
private static class Fake extends Coin {
|
||||
|
||||
/**
|
||||
* Creates a fake coin with a specified weight of lighter or heavier than
|
||||
* a regular coin.
|
||||
*
|
||||
* @precondition none
|
||||
* @postcondition a coin is created
|
||||
*
|
||||
* @param location the location of the fake coin
|
||||
* @param isLighter if it is lighter or not.
|
||||
*/
|
||||
public Fake(int location, boolean isLighter) {
|
||||
super(location);
|
||||
if (isLighter)
|
||||
|
Loading…
Reference in New Issue
Block a user