Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.HashMap;
- import java.util.Map;
- public class ClubeDoLivro {
- private Map<String, Livro> livros;
- public ClubeDoLivro() {
- livros = new HashMap<String, Livro>();
- }
- public void adicionaLivro(String titulo, String autor, int ano, String isbn) throws Exception{
- if (livros.containsKey(isbn)){
- throw new Exception("Livro ja pertence ao acervo.");
- } else {
- Livro livro = new Livro(titulo, autor, ano, isbn);
- livros.put(isbn, livro);
- }
- }
- public void importaLivros(String filename) throws Exception{
- }
- public Livro buscaLivro(String isbn) throws Exception {
- return null;
- }
- public void adicionaOpiniao(String isbn, int nota, String autor, String comentario) throws Exception {
- }
- public double getNotaGeral(String isbn) throws Exception {
- return 0.0;
- }
- public void listaOpinioes(String isbn) throws Exception{
- }
- public void ranking(int n) throws Exception{
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement