1 4 package demo.townsend.service; 5 6 import java.util.ArrayList ; 7 8 public class ProductCatalog { 9 10 private ArrayList catalog; 11 12 public ProductCatalog() { 13 catalog = new ArrayList (); 14 if (!catalog.isEmpty()) { 15 return; 16 } 17 catalog.add(new Product("0001", 10, "Canon PowerShot A620", "7.1 Megapixel Digital")); 18 catalog.add(new Product("0002", 24, "Olympus EVOLT E-500", "8.0 Megapixel Digital SLR Camera w/2.5\" LCD & Two Lenses")); 19 catalog.add(new Product("0003", 150, "Canon PowerShot SD450", "5.0 Megapixel Digital Camera w/3x Zoom & 2.5\" LCD")); 20 catalog.add(new Product("0004", 165, "Fuji FinePix A345", "4.1 Megapixel Digital Camera")); 21 catalog.add(new Product("0005", 205, "Olympus SP-310", "7.1 Megapixel Digital Camera")); 22 catalog.add(new Product("0006", 90, "Canon PowerShot A520", "4.0 Megapixel Digital Camera w/4X Zoom")); 23 catalog.add(new Product("0007", 4, "Canon PowerShot SD500", "7.1 Megapixel Digital Camera w/3x Optical Zoom")); 24 catalog.add(new Product("0008", 14, "Casio EX-Z850", "8.0 MegaPixel Camera with 3x Optical Zoom and Super Bright 2.5\" LCD")); 25 } 26 27 public ArrayList getCatalog() { 28 return catalog; 29 } 30 } 31 | Popular Tags |