FileDocCategorySizeDatePackage
BookInfo.javaAPI DocExample2529Thu Dec 19 20:32:42 GMT 2002ora.jwsnut.chapter2.bookservice

BookInfo.java

package ora.jwsnut.chapter2.bookservice;

/** 
 * A class that holds information relating
 * to a book known to the book web service.
 */
public class BookInfo {
    
    /**
     * The title of the book.
     */
    private String title;
    
    /**
     * The book's author (or authors)
     */
    private String author;
    
    /**
     * The book's editor
     */
    private String editor;
    
    /**
     * The list price of the book.
     */
    private double price;
    
    /**
     * Constructs an uninitialized <code>BookInfo</code> object.
     */
    public BookInfo() {
    }
    
    /**
     * Constructs a <code>BookInfo</code> object initialized 
     * with given attributes.
     * @param title the book's title
     * @param author the name of the book's author
     * @param editor the name of the book's editor
     * @param price the price of the book.
     */
    public BookInfo(String title, String author, String editor, double price) {
        this.title = title;
        this.author = author;
        this.editor = editor;
        this.price = price;
    }
    
    /**
     * Gets the title of the book
     * @return the book's title.
     */
    public String getTitle() {
        return title;
    }
    
    /**
     * Gets the author of the book
     * @return the book's author.
     */
    public String getAuthor() {
        return author;
    }
    
    /**
     * Gets the name of the editor the book
     * @return the book's editor.
     */
    public String getEditor() {
        return editor;
    }
    
    /**
     * Gets the price of the book in USD
     * @return the book's price.
     */
    public double getPrice() {
        return price;
    } 
        
    /**
     * Sets the title of the book
     * @param title the book's title.
     */
    public void setTitle(String title) {
        this.title = title;
    }
    
    /**
     * Sets the author of the book
     * @param author the book's author.
     */
    public void setAuthor(String author) {
        this.author = author;
    }
    
    /**
     * Sets the name of the editor the book
     * @param editor the book's editor.
     */
    public void setEditor(String editor) {
        this.editor = editor;
    }
    
    /**
     * Sets the price of the book in USD
     * @param price the book's price.
     */
    public void setPrice(double price) {
        this.price = price;
    }    
}