tidy lab
This commit is contained in:
4 files changed
+17
-8
No files matched your search
@@ -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
|
||||
*/
|
||||
|
||||
@@ -15,9 +15,11 @@ import java.util.Iterator;
|
||||
* @author Braeden Sowinski
|
||||
* @author Trishaan Shetty
|
||||
* @author Nico Agostini
|
||||
* @author Calvin Arifianto
|
||||
* @version 1.0.0
|
||||
*/
|
||||
public class BookStore {
|
||||
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;
|
||||
@@ -26,7 +28,7 @@ public class BookStore {
|
||||
private final List<Novel> 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
|
||||
*/
|
||||
@@ -144,7 +146,7 @@ public class BookStore {
|
||||
final List<String> keyList;
|
||||
final Iterator<String> iter;
|
||||
|
||||
novelsMap = new HashMap<String, Novel>();
|
||||
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());
|
||||
}
|
||||
}
|
||||
@@ -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++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<Novel>
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user