@@ -0,0 +1,2819 @@
+package com.oozinoz.fireworks;%0A%0A/*%0A * Copyright (c) 2001 Steven J. Metsker.%0A * %0A * Steve Metsker makes no representations or warranties about%0A * the fitness of this software for any particular purpose, %0A * including the implied warranty of merchantability.%0A *%0A * Please use this software as you wish with the sole%0A * restriction that you may not claim that you wrote it.%0A */%0A/**%0A * Objects of this class represent types of fireworks.%0A * %0A * @author Steven J. Metsker%0A */%0Apublic class Firework%0Aimplements ClassificationConstants %0A%7B%0A%09protected String name;%0A%09protected Classification classification;%0A%0A%0A/**%0A * Returns this firework's classification.%0A *%0A * @return this firework's classification%0A */%0Apublic Classification getClassification()%0A%7B%0A%09return classification;%0A%7D%0A/**%0A * Set this firework's classification.%0A *%0A * @param Classification this firework's classification%0A */%0Apublic void setClassification(Classification classification)%0A%7B%0A%09this.classification = classification;%0A%7D%0A%0A%09protected double price;%0A%0A/**%0A * Construct a firework with the given name.%0A *%0A * @param String the name of the firework%0A * @param double the price of the firework%0A */%0Apublic Firework(String name, double price) %0A%7B%0A%09this(name, price, DISPLAY);%0A%7D%0A%0A/**%0A * Construct a firework with the given name and classification.%0A *%0A * @param String the name of the firework%0A * @param double the price of the firework%0A * @param Classification the classification of the %0A *                       firework%0A */%0Apublic Firework(%0A%09String name,%0A%09double price,%0A%09Classification classification)%0A%7B%0A%09this.name = name;%0A%09this.price = price;%0A%09this.classification = classification;%0A%7D%0A%0A/**%0A * This method exists mainly to show what can happen when%0A * a subclass shadows a static method. See %22Introducing%0A * Operations%22 in %22The Design Patterns Java Workbook.%22%0A */%0Apublic static boolean flies()%0A%7B%0A%09return false;%0A%7D%0A%0A/**%0A * Return the name of this firework%0A *%0A * @return the name of this firework%0A */%0Apublic String getName()%0A%7B%0A%09return name;%0A%7D%0A%0A/**%0A * Return the price of this firework%0A *%0A * @return the price of this firework%0A */%0Apublic double getPrice()%0A%7B%0A%09return price;%0A%7D%0A%0A/**%0A * Return a random firework from our shelves.%0A *%0A * @return a random firework from our shelves; not actually %0A *         implemented%0A */%0Apublic static Firework getRandom()%0A%7B%0A%09return null;%0A%7D%0A%0A/**%0A * Return the type of this firework, essentially the%0A * class's name.%0A *%0A * @return the type of this firework, essentially the%0A *         class's name%0A */%0Apublic String getType()%0A%7B%0A%09String s = getClass().getName();%0A%09return s.substring(s.lastIndexOf('.') + 1);%0A%7D%0A%0A/**%0A * Return a firework of the given name.%0A *%0A * @param name a name to lookup%0A * @return a firework of the given name; not actually %0A *         implemented%0A */%0Apublic static Firework lookup(String name)%0A%7B%0A%09return new Firework(%22demo%22, 0);%0A%7D%0A%7D%0A

Create Firework.java