@Test public void getAmazonItemsTest() { String[] urls = itemsExamples; AmazonItemLookUp lookUp = new AmazonItemLookUp(urls); AmazonItem[] items = lookUp.getAmazonItems(); for (int i = 0; i < items.length; i++) { System.out.printf("Item %d\n", i + 1); System.out.printf("Title: %s\n", items[i].title); System.out.printf("URL: %s\n", items[i].url); System.out.printf("Previous price: %f\n", items[i].previousPrice); System.out.printf("Current price: %f\n\n", items[i].currentPrice); } System.out.printf("Number of items: %d", urls.length); }
public AmazonItem[] getAmazonItems() { this.mAmazonItems = new AmazonItem[this.mDocuments.length]; Float[] prices = getPrices(this.mDocuments); String[] titles = getTitles(this.mDocuments); for (int i = 0; i < this.mAmazonItems.length; i++) { if (this.mDocuments[i] == null) { this.mAmazonItems[i] = null; } else { this.mAmazonItems[i] = new AmazonItem(titles[i], prices[i], this.mUrls[i]); } } return this.mAmazonItems; }
AmazonItemLookUp { public AmazonItem[] getAmazonItems() { this.mAmazonItems = new AmazonItem[this.mDocuments.length]; Float[] prices = getPrices(this.mDocuments); String[] titles = getTitles(this.mDocuments); for (int i = 0; i < this.mAmazonItems.length; i++) { if (this.mDocuments[i] == null) { this.mAmazonItems[i] = null; } else { this.mAmazonItems[i] = new AmazonItem(titles[i], prices[i], this.mUrls[i]); } } return this.mAmazonItems; } }
AmazonItemLookUp { public AmazonItem[] getAmazonItems() { this.mAmazonItems = new AmazonItem[this.mDocuments.length]; Float[] prices = getPrices(this.mDocuments); String[] titles = getTitles(this.mDocuments); for (int i = 0; i < this.mAmazonItems.length; i++) { if (this.mDocuments[i] == null) { this.mAmazonItems[i] = null; } else { this.mAmazonItems[i] = new AmazonItem(titles[i], prices[i], this.mUrls[i]); } } return this.mAmazonItems; } AmazonItemLookUp(String[] urls);  AmazonItemLookUp(AmazonItem[] amazonItems, Integer maxDelay); }
AmazonItemLookUp { public AmazonItem[] getAmazonItems() { this.mAmazonItems = new AmazonItem[this.mDocuments.length]; Float[] prices = getPrices(this.mDocuments); String[] titles = getTitles(this.mDocuments); for (int i = 0; i < this.mAmazonItems.length; i++) { if (this.mDocuments[i] == null) { this.mAmazonItems[i] = null; } else { this.mAmazonItems[i] = new AmazonItem(titles[i], prices[i], this.mUrls[i]); } } return this.mAmazonItems; } AmazonItemLookUp(String[] urls);  AmazonItemLookUp(AmazonItem[] amazonItems, Integer maxDelay); AmazonItem[] getAmazonItems(); AmazonItem[] updateAmazonItems(); }
AmazonItemLookUp { public AmazonItem[] getAmazonItems() { this.mAmazonItems = new AmazonItem[this.mDocuments.length]; Float[] prices = getPrices(this.mDocuments); String[] titles = getTitles(this.mDocuments); for (int i = 0; i < this.mAmazonItems.length; i++) { if (this.mDocuments[i] == null) { this.mAmazonItems[i] = null; } else { this.mAmazonItems[i] = new AmazonItem(titles[i], prices[i], this.mUrls[i]); } } return this.mAmazonItems; } AmazonItemLookUp(String[] urls);  AmazonItemLookUp(AmazonItem[] amazonItems, Integer maxDelay); AmazonItem[] getAmazonItems(); AmazonItem[] updateAmazonItems();  }