Added JavaDocs to Coin/Fake classes.

This commit is contained in:
Jonathan Turner 2024-02-14 12:46:49 -05:00
parent abe66c0862
commit 5f37a3a97b

View File

@ -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)