FileDocCategorySizeDatePackage
ReceiptDTO.javaAPI DocExample884Mon Nov 24 22:05:54 GMT 2003com.oreilly.patterns.chapter9

ReceiptDTO

public class ReceiptDTO extends Object

Fields Summary
private float
totalPrice
private String[]
descriptions
private float[]
prices
Constructors Summary
public ReceiptDTO(LocalItem[] items, LocalSalesRecord record)

        descriptions = new String[items.length];
        prices = new float[items.length];
        
        for (int i = 0; i < items.length; i++) {
            descriptions[i] = items[i].getDescription();
            prices[i] = items[i].getPrice();
        }
        
        totalPrice = record.getTotalPrice();
    
Methods Summary
public intgetItemCount()

        return descriptions.length;
    
public java.lang.StringgetItemDescription(int index)

        return descriptions[index];
    
public floatgetItemPrice(int index)

        return prices[index];
    
public floatgetTotalPrice()

        return totalPrice;