Skip to content

Commit

Permalink
Style fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Oscar-B-Liang committed Sep 25, 2019
1 parent 9b21519 commit f76e008
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
package seedu.address.Flashcard;
package seedu.address.flashcard;

/**
* The unique identity number for each flash card.
* Guarantees: Each card's id number is unique.
*/
public class CardID {
public class CardId {

private final int identityNumber;
// The id number for the next flash card generated.
private static int frontier = 0;
private final int identityNumber;

/**
* Constructor of the class, automatically generate a unique identity number.
*/
public CardID() {
public CardId() {
identityNumber = frontier;
frontier++;
}
Expand All @@ -22,6 +22,11 @@ public int getIdentityNumber() {
return identityNumber;
}

/**
* While finding a flashcard, compare that the id number of this card matches the search string or not.
* @param s The search parameter, target string.
* @return true if the id number indeed contains the target information, false otherwise.
*/
public boolean contains(String s) {
String idAsString = Integer.toString(identityNumber);
return idAsString.contains(s);
Expand All @@ -37,10 +42,10 @@ public boolean equals(Object other) {
if (other == this) {
return true;
}
if (!(other instanceof CardID)) {
if (!(other instanceof CardId)) {
return false;
}
return identityNumber == ((CardID) other).getIdentityNumber();
return identityNumber == ((CardId) other).getIdentityNumber();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address.Flashcard;
package seedu.address.flashcard;

/**
* The record of how many correct and wrong answers has the user done.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
package seedu.address.Flashcard;
package seedu.address.flashcard;

import static seedu.address.commons.util.AppUtil.checkArgument;

/**
* The time limit for doing a quiz
* Guarantees: Does not exceed an hour, minutes and seconds are both between 0 and 60.
*/
public class TimeLimit {

private static final String MESSAGE_CONSTRAINTS = "Time limit must be in the format of two integers,"
Expand Down

0 comments on commit f76e008

Please sign in to comment.