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
|
* Biography constructor
|
||||||
* @param title String title of Biography
|
* @param title title of Biography
|
||||||
* @param year int Year Biography was published
|
* @param year Year Biography was published
|
||||||
* @param author Author of the Biography
|
* @param author Author of the Biography
|
||||||
* @param subject Person that the Biography is about
|
* @param subject Person that the Biography is about
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -15,9 +15,11 @@ import java.util.Iterator;
|
|||||||
* @author Braeden Sowinski
|
* @author Braeden Sowinski
|
||||||
* @author Trishaan Shetty
|
* @author Trishaan Shetty
|
||||||
* @author Nico Agostini
|
* @author Nico Agostini
|
||||||
|
* @author Calvin Arifianto
|
||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
*/
|
*/
|
||||||
public class BookStore {
|
public class BookStore
|
||||||
|
{
|
||||||
private static final int DECADE_RANGE = 9;
|
private static final int DECADE_RANGE = 9;
|
||||||
private static final int DEFAULT_LONGEST_VALUE = 0;
|
private static final int DEFAULT_LONGEST_VALUE = 0;
|
||||||
private static final int TO_PERCENTAGE = 100;
|
private static final int TO_PERCENTAGE = 100;
|
||||||
@@ -26,7 +28,7 @@ public class BookStore {
|
|||||||
private final List<Novel> novels;
|
private final List<Novel> novels;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BookStore constructor creats a bookstore, and tests
|
* BookStore constructor creates a bookstore, and tests
|
||||||
* hash maps and iterators
|
* hash maps and iterators
|
||||||
* @param bookStoreName - The bookStoreName to call bookstore
|
* @param bookStoreName - The bookStoreName to call bookstore
|
||||||
*/
|
*/
|
||||||
@@ -144,7 +146,7 @@ public class BookStore {
|
|||||||
final List<String> keyList;
|
final List<String> keyList;
|
||||||
final Iterator<String> iter;
|
final Iterator<String> iter;
|
||||||
|
|
||||||
novelsMap = new HashMap<String, Novel>();
|
novelsMap = new HashMap<>();
|
||||||
|
|
||||||
for (final Novel novel : this.novels) {
|
for (final Novel novel : this.novels) {
|
||||||
novelsMap.put(novel.getTitle(), novel);
|
novelsMap.put(novel.getTitle(), novel);
|
||||||
@@ -213,8 +215,11 @@ public class BookStore {
|
|||||||
*/
|
*/
|
||||||
public void printGroupByDecade(final int decade)
|
public void printGroupByDecade(final int decade)
|
||||||
{
|
{
|
||||||
for (final Novel novel : this.novels) {
|
for (final Novel novel : this.novels)
|
||||||
if (novel.getYearPublished() >= decade && novel.getYearPublished() <= decade + DECADE_RANGE) {
|
{
|
||||||
|
if (novel.getYearPublished() >= decade &&
|
||||||
|
novel.getYearPublished() <= decade + DECADE_RANGE)
|
||||||
|
{
|
||||||
System.out.println(novel.getTitle());
|
System.out.println(novel.getTitle());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -294,7 +299,8 @@ public class BookStore {
|
|||||||
inRange = DEFAULT_LONGEST_VALUE;
|
inRange = DEFAULT_LONGEST_VALUE;
|
||||||
|
|
||||||
for (final Novel novel : this.novels) {
|
for (final Novel novel : this.novels) {
|
||||||
if (novel.getYearPublished() >= first && novel.getYearPublished() <= last) {
|
if (novel.getYearPublished() >= first &&
|
||||||
|
novel.getYearPublished() <= last) {
|
||||||
inRange++;
|
inRange++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ package ca.bcit.comp2522.lab05;
|
|||||||
* @author Braeden Sowinski
|
* @author Braeden Sowinski
|
||||||
* @author Nico Agostini
|
* @author Nico Agostini
|
||||||
* @author Trishaan Shetty
|
* @author Trishaan Shetty
|
||||||
|
* @author Calvin Arifianto
|
||||||
|
* @version 1.0.0
|
||||||
*/
|
*/
|
||||||
public class Novel
|
public class Novel
|
||||||
implements Comparable<Novel>
|
implements Comparable<Novel>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ package ca.bcit.comp2522.lab05;
|
|||||||
* @author Braeden Sowinski
|
* @author Braeden Sowinski
|
||||||
* @author Trishaan Shetty
|
* @author Trishaan Shetty
|
||||||
* @author Nico Agostini
|
* @author Nico Agostini
|
||||||
|
* @author Calvin Arifianto
|
||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
*/
|
*/
|
||||||
public class Validator {
|
public class Validator {
|
||||||
|
|||||||
Reference in new issue
Block a user