forked from nus-cs2103-AY2324S1/tp
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into pr/129
- Loading branch information
Showing
41 changed files
with
621 additions
and
323 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/main/java/wedlog/address/model/DietaryRequirementStatistics.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package wedlog.address.model; | ||
|
||
import java.util.HashMap; | ||
|
||
/** | ||
* This class encapsulates the dietary requirement statistics of the guests. | ||
* It stores each dietary requirement as a key and the number of guests with that dietary requirement as the value. | ||
* @author Keagan | ||
*/ | ||
public class DietaryRequirementStatistics { | ||
private final HashMap<String, Integer> dietaryRequirementMap; | ||
|
||
/** | ||
* Constructor for an empty {@code DietaryRequirementStatistics} object. | ||
*/ | ||
public DietaryRequirementStatistics() { | ||
this.dietaryRequirementMap = new HashMap<>(); | ||
} | ||
|
||
/** | ||
* Constructor for a {@code DietaryRequirementStatistics} object. | ||
* @param dietaryRequirementMap The map of dietary requirements to the number of guests | ||
* with that dietary requirement. | ||
*/ | ||
public DietaryRequirementStatistics(HashMap<String, Integer> dietaryRequirementMap) { | ||
this.dietaryRequirementMap = dietaryRequirementMap; | ||
} | ||
|
||
public HashMap<String, Integer> getMap() { | ||
return this.dietaryRequirementMap; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object other) { | ||
if (other == this) { | ||
return true; | ||
} | ||
|
||
if (!(other instanceof DietaryRequirementStatistics)) { | ||
return false; | ||
} | ||
|
||
DietaryRequirementStatistics otherDietaryRequirementStatistics = (DietaryRequirementStatistics) other; | ||
return this.dietaryRequirementMap.equals(otherDietaryRequirementStatistics.dietaryRequirementMap); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 0 additions & 88 deletions
88
src/main/java/wedlog/address/model/person/DietaryRequirements.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.