FileDocCategorySizeDatePackage
ReportOperations.javaAPI DocExample1689Wed May 04 06:17:06 BST 2005com.samscdrental.controller

ReportOperations

public class ReportOperations extends Object

Fields Summary
private StoreDataAccess
collections
private static ReportOperations
theInstance
Constructors Summary
private ReportOperations()

	
Methods Summary
public static com.samscdrental.controller.ReportOperationsgetInstance()

		if ( theInstance == null )
		{
			theInstance = new ReportOperations();
		}
		return theInstance;

	
public CDDiscInventoryDTOmakeCDDiscInventoryDTO()

		CDDiscInventoryDTO cdidto = new CDDiscInventoryDTO();
		CDDisc[] cdDiscs = collections.theCDDiscDataAccess.findAll();
		cdidto.theCDDiscInventoryItems = new CDDiscInventoryItem[cdDiscs.length];
		for ( int i = 0; i < cdDiscs.length; i++ )
		{
			CDDisc aCDDisc = cdDiscs[i];
			Rental aRental = aCDDisc.getRental();
			CDDiscInventoryItem dii = new CDDiscInventoryItem();
			dii.isCDDiscRented = aCDDisc.isRented();
			dii.theCDDiscPhysicalID = aCDDisc.getPhysicalID();
			if ( aCDDisc.isRented() )
			{
				dii.theCustomerID = aRental.getCustomer().getCustomerID();
			}
			else
			{
				dii.theCustomerID = new CustomerID();
			}
			cdidto.theCDDiscInventoryItems[i] = dii;
		}
		return cdidto;

	
public CDDiscInventoryReportPlainTextFormatmakeCDDiscInventoryReportPlainTextFormat()

		CDDiscInventoryDTO aCDDiscInventoryDTO =
			makeCDDiscInventoryDTO();
		CDDiscInventoryReportPlainTextFormat irptf =
			new CDDiscInventoryReportPlainTextFormat( aCDDiscInventoryDTO );
		return irptf;