/** * class for handling a book citation * * author: Luc Longpré * 10/24/2005 */ public class Book extends Reference { String publisher; String volume; //optional in a citation String address; //optional in a citation String edition; //optional in a citation public Book(String theAuthor, String theTitle, String thePublisher, String theYear, String theVolume, String theAddress, String theEdition) { super(theAuthor,theTitle,theYear); publisher = thePublisher; volume = theVolume; address = theAddress; edition = theEdition; } public String toString() { String outString; outString = author + ", \"" + title + ",\" "; if (!volume.equals("")) outString = outString + "volume " + volume + ", "; outString = outString + publisher + ", "; if (!address.equals("")) outString = outString + address + ", "; if (!edition.equals("")) outString = outString + edition + " edition, "; outString = outString + year + "."; return outString; } }