HouseOver.THARM.CustomerCatalogue.Compares.ProfileMaxPriceComparer Class Reference

A class which compares the maximum prices of the profiles of two users. More...

Collaboration diagram for HouseOver.THARM.CustomerCatalogue.Compares.ProfileMaxPriceComparer:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ProfileMaxPriceComparer (CatalogueData data)
 Constructor for the ProfileMaxPriceComparer class.
int Compare (Customer x, Customer y)
 Compare the price of the largest Profile of Customer x with the price of the largest Profile of Customer y.
 ProfileMaxPriceComparer (CatalogueData data)
 Constructor for the ProfileMaxPriceComparer class.
int Compare (Customer x, Customer y)
 Compare the price of the largest Profile of Customer x with the price of the largest Profile of Customer y.

Private Attributes

CatalogueData data
 The data catalogue to work on.

Detailed Description

A class which compares the maximum prices of the profiles of two users.

Definition at line 13 of file ProfileMaxPrice.cs.


Constructor & Destructor Documentation

HouseOver.THARM.CustomerCatalogue.Compares.ProfileMaxPriceComparer.ProfileMaxPriceComparer ( CatalogueData  data  ) 

Constructor for the ProfileMaxPriceComparer class.

Parameters:
data The data catalogue to work on

Definition at line 22 of file ProfileMaxPrice.cs.

00023         {
00024             this.data = data;
00025         }

HouseOver.THARM.CustomerCatalogue.Compares.ProfileMaxPriceComparer.ProfileMaxPriceComparer ( CatalogueData  data  ) 

Constructor for the ProfileMaxPriceComparer class.

Parameters:
data The data catalogue to work on

Definition at line 22 of file ProfileMaxPrice.cs.

00023         {
00024             this.data = data;
00025         }


Member Function Documentation

int HouseOver.THARM.CustomerCatalogue.Compares.ProfileMaxPriceComparer.Compare ( Customer  x,
Customer  y 
)

Compare the price of the largest Profile of Customer x with the price of the largest Profile of Customer y.

Parameters:
x The first customer
y The second customer
Returns:
The result of the comparison of the maximum prices

Definition at line 33 of file ProfileMaxPrice.cs.

00034         {
00035             int c1 = 0;
00036             int c2 = 0;
00037 
00038             foreach (Profile p in data.GetProfiles(x))
00039             {
00040                 if (p.MaxPrice > c1) c1 = p.MaxPrice;
00041             }
00042 
00043             foreach (Profile p in data.GetProfiles(y))
00044             {
00045                 if (p.MaxPrice > c2) c1 = p.MaxPrice;
00046             }
00047 
00048             return c1.CompareTo(c2);
00049         }

int HouseOver.THARM.CustomerCatalogue.Compares.ProfileMaxPriceComparer.Compare ( Customer  x,
Customer  y 
)

Compare the price of the largest Profile of Customer x with the price of the largest Profile of Customer y.

Parameters:
x The first customer
y The second customer
Returns:
The result of the comparison of the maximum prices

Definition at line 33 of file ProfileMaxPrice.cs.

00034         {
00035             int c1 = 0;
00036             int c2 = 0;
00037 
00038             foreach (Profile p in data.GetProfiles(x))
00039             {
00040                 if (p.MaxPrice > c1) c1 = p.MaxPrice;
00041             }
00042 
00043             foreach (Profile p in data.GetProfiles(y))
00044             {
00045                 if (p.MaxPrice > c2) c1 = p.MaxPrice;
00046             }
00047 
00048             return c1.CompareTo(c2);
00049         }


Member Data Documentation

CatalogueData HouseOver::THARM::CustomerCatalogue::Compares.ProfileMaxPriceComparer::data [private]

The data catalogue to work on.

Definition at line 16 of file ProfileMaxPrice.cs.


The documentation for this class was generated from the following files:
Generated on Wed Jan 10 03:43:17 2007 for THARM by  doxygen 1.5.1-p1