diff --git a/src/code/ca/bcit/comp2522/lab04/Biography.java b/src/code/ca/bcit/comp2522/lab04/Biography.java index c0c7c0a..a9f64e8 100644 --- a/src/code/ca/bcit/comp2522/lab04/Biography.java +++ b/src/code/ca/bcit/comp2522/lab04/Biography.java @@ -18,8 +18,8 @@ public class Biography /** * Biography constructor - * @param title String title of Biography - * @param year int Year Biography was published + * @param title title of Biography + * @param year Year Biography was published * @param author Author of the Biography * @param subject Person that the Biography is about */ diff --git a/src/code/ca/bcit/comp2522/lab05/BookStore.java b/src/code/ca/bcit/comp2522/lab05/BookStore.java index 10a1c0b..2e19cd2 100644 --- a/src/code/ca/bcit/comp2522/lab05/BookStore.java +++ b/src/code/ca/bcit/comp2522/lab05/BookStore.java @@ -15,18 +15,20 @@ import java.util.Iterator; * @author Braeden Sowinski * @author Trishaan Shetty * @author Nico Agostini + * @author Calvin Arifianto * @version 1.0.0 */ -public class BookStore { - private static final int DECADE_RANGE = 9; +public class BookStore +{ + private static final int DECADE_RANGE = 9; private static final int DEFAULT_LONGEST_VALUE = 0; - private static final int TO_PERCENTAGE = 100; + private static final int TO_PERCENTAGE = 100; private final String bookStoreName; private final List novels; /** - * BookStore constructor creats a bookstore, and tests + * BookStore constructor creates a bookstore, and tests * hash maps and iterators * @param bookStoreName - The bookStoreName to call bookstore */ @@ -140,11 +142,11 @@ public class BookStore { novels.add(new Novel("Wide Sargasso Sea", "Jean Rhys", 1966)); final Map novelsMap; - final Set keySet; - final List keyList; - final Iterator iter; + final Set keySet; + final List keyList; + final Iterator iter; - novelsMap = new HashMap(); + novelsMap = new HashMap<>(); for (final Novel novel : this.novels) { novelsMap.put(novel.getTitle(), novel); @@ -213,8 +215,11 @@ public class BookStore { */ public void printGroupByDecade(final int decade) { - for (final Novel novel : this.novels) { - if (novel.getYearPublished() >= decade && novel.getYearPublished() <= decade + DECADE_RANGE) { + for (final Novel novel : this.novels) + { + if (novel.getYearPublished() >= decade && + novel.getYearPublished() <= decade + DECADE_RANGE) + { System.out.println(novel.getTitle()); } } @@ -234,7 +239,7 @@ public class BookStore { for (final Novel novel : this.novels) { if (novel.getTitle().length() > longest) { longest = novel.getTitle().length(); - title = novel.getTitle(); + title = novel.getTitle(); } } @@ -294,7 +299,8 @@ public class BookStore { inRange = DEFAULT_LONGEST_VALUE; for (final Novel novel : this.novels) { - if (novel.getYearPublished() >= first && novel.getYearPublished() <= last) { + if (novel.getYearPublished() >= first && + novel.getYearPublished() <= last) { inRange++; } } diff --git a/src/code/ca/bcit/comp2522/lab05/Novel.java b/src/code/ca/bcit/comp2522/lab05/Novel.java index 5980f8c..1f4f1b9 100644 --- a/src/code/ca/bcit/comp2522/lab05/Novel.java +++ b/src/code/ca/bcit/comp2522/lab05/Novel.java @@ -7,6 +7,8 @@ package ca.bcit.comp2522.lab05; * @author Braeden Sowinski * @author Nico Agostini * @author Trishaan Shetty + * @author Calvin Arifianto + * @version 1.0.0 */ public class Novel implements Comparable diff --git a/src/code/ca/bcit/comp2522/lab05/Validator.java b/src/code/ca/bcit/comp2522/lab05/Validator.java index 65ab978..cb17177 100644 --- a/src/code/ca/bcit/comp2522/lab05/Validator.java +++ b/src/code/ca/bcit/comp2522/lab05/Validator.java @@ -6,6 +6,7 @@ package ca.bcit.comp2522.lab05; * @author Braeden Sowinski * @author Trishaan Shetty * @author Nico Agostini + * @author Calvin Arifianto * @version 1.0.0 */ public class Validator {