1 25 26 package org.objectweb.speedo.tutorial.pobjects.additional.detach; 27 28 31 public class Book { 32 33 private String title; 34 private Author author; 35 private Editor editor; 36 private int year; 37 38 public Book(String title, Author author, Editor editor, int year) { 39 this.title = title; 40 this.author = author; 41 this.editor = editor; 42 this.year = year; 43 } 44 45 public Author getAuthor() { 46 return author; 47 } 48 public void setAuthor(Author author) { 49 this.author = author; 50 } 51 public Editor getEditor() { 52 return editor; 53 } 54 public void setEditor(Editor editor) { 55 this.editor = editor; 56 } 57 public String getTitle() { 58 return title; 59 } 60 public void setTitle(String title) { 61 this.title = title; 62 } 63 public int getYear() { 64 return year; 65 } 66 public void setYear(int year) { 67 this.year = year; 68 } 69 70 public String toString(){ 71 return title +", author=[" + author.toString() + "], editor=[" + editor.toString() + "], " + year; 72 } 73 } 74 | Popular Tags |