Skip to content

Commit

Permalink
Align return types between README and /resources in Homework 02 assig…
Browse files Browse the repository at this point in the history
…nment
  • Loading branch information
100yo committed Dec 12, 2024
1 parent fc050fc commit fff7959
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 21 deletions.
20 changes: 10 additions & 10 deletions homeworks/02-goodreads/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,22 @@

```java
package bg.sofia.uni.fmi.mjt.goodreads.recommender;

import bg.sofia.uni.fmi.mjt.goodreads.book.Book;
import java.util.Map;

import java.util.SortedMap;

public interface BookRecommenderAPI {

/**
* Searches for books that are similar to the provided one.
*
* @param originBook the book we should calculate similarity with.
* @param maxN - the maximum number of entries returned
* @throws IllegalArgumentException if the originBook is null.
* @throws IllegalArgumentException if maxN is smaller than or equal to 0.
* @return a Map<Book, Double> representing the top maxN closest books with their similarity to originBook
* ordered by their similarity score in descending order
* @param originBook the book we should calculate similarity with.
* @param maxN the maximum number of entries returned
* @return a SortedMap<Book, Double> representing the top maxN closest books
* with their similarity to originBook ordered by their similarity score
* @throws IllegalArgumentException if the originBook is null.
* @throws IllegalArgumentException if maxN is smaller or equal to 0.
*/
SortedMap<Book, Double> recommendBooks(Book originBook, int maxN);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@
import bg.sofia.uni.fmi.mjt.goodreads.book.Book;
import bg.sofia.uni.fmi.mjt.goodreads.recommender.similaritycalculator.SimilarityCalculator;

import java.util.Map;
import java.util.Set;
import java.util.SortedMap;

public class BookRecommender implements BookRecommenderAPI {

public BookRecommender(Set<Book> initialBooks, SimilarityCalculator calculator) {}

public BookRecommender(Set<Book> initialBooks, SimilarityCalculator calculator) {
throw new UnsupportedOperationException("Not yet implemented");
}

@Override
public Map<Book, Double> recommendBooks(Book origin, int maxN) {
public SortedMap<Book, Double> recommendBooks(Book origin, int maxN) {
throw new UnsupportedOperationException("Not yet implemented");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@

import bg.sofia.uni.fmi.mjt.goodreads.book.Book;

import java.util.Map;
import java.util.SortedMap;

public interface BookRecommenderAPI {

/**
* Searches for books that are similar to the provided one.
*
* @param originBook the book we should calculate similarity with.
* @param maxN - the maximum number of entries returned
* @param originBook the book we should calculate similarity with.
* @param maxN the maximum number of entries returned
* @return a SortedMap<Book, Double> representing the top maxN closest books
* with their similarity to originBook ordered by their similarity score
* @throws IllegalArgumentException if the originBook is null.
* @throws IllegalArgumentException if maxN is smaller or equal to 0.
* @return a Map<Book, Double> representing the top maxN closest books with their similarity to originBook ordered by their similarity score
*/
Map<Book, Double> recommendBooks(Book originBook, int maxN);
SortedMap<Book, Double> recommendBooks(Book originBook, int maxN);

}

0 comments on commit fff7959

Please sign in to comment.