WorkContract Class Reference

The WorkContract is a contract between a Firm and a Household, which defines the amount of work and the wage. More...

Collaboration diagram for WorkContract:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 WorkContract (@NotNull Firm pEmployer,@AssertFieldConstraints("amount") double pAmount)
 The WorkContract constructor.

Package Types

enum  Status
 The status of this work contract. More...

Private Member Functions

boolean isValidAmount (double pAmountToTest)
 The fraction of working time that the Household uses for the job of this contract.

Private Attributes

Status status = Status.OFFERED
 The status of this work contract.
final Firm employer
 The employer of this WorkContract.

Classes

class  WageComparator
 This Comparator is used to sort work contracts in dependency of the wage.


Detailed Description

The WorkContract is a contract between a Firm and a Household, which defines the amount of work and the wage.

Definition at line 33 of file WorkContract.java.


Member Enumeration Documentation

enum Status [package]

The status of this work contract.

The work contract is set to OFFERED before the household checks the conditions in Household.checkOfferedWorkContract. The Household sets the status to REJECTED or ACCEPTED. The household can ask the firm for a WorkContract as a form of speculative application, if the firm doesn't have a job for the household, the status is set to NO_OFFER.

Definition at line 41 of file WorkContract.java.

00041 { OFFERED, NO_OFFER, REJECTED, ACCEPTED }


Constructor & Destructor Documentation

WorkContract ( @NotNull Firm  pEmployer,
@AssertFieldConstraints("amount") double  pAmount 
)

The WorkContract constructor.

Parameters:
pAmount The WorkContract.amount of work declared in this contract.

Definition at line 109 of file WorkContract.java.

00110                                                                         {
00111     employer = pEmployer;
00112     amount = pAmount;
00113   }


Member Function Documentation

boolean isValidAmount ( double  pAmountToTest  )  [private]

The fraction of working time that the Household uses for the job of this contract.

The sum of the amounts of all WorkContracts of one Household is a value between 0 <= amount <= 1.

Definition at line 90 of file WorkContract.java.

00090                                                       {
00091     if (status == Status.ACCEPTED) {
00092       return ((amount > 0.d) && (amount <= 1.d));
00093     } else {
00094       return (amount >= 0.d);
00095     }
00096   }


Member Data Documentation

Status status = Status.OFFERED [private]

The status of this work contract.

The work contract is set to OFFERED before the household checks the conditions in Household.checkOfferedWorkContract. The Household sets the status to REJECTED or ACCEPTED.

Definition at line 77 of file WorkContract.java.

Referenced by WorkContract.isValidAmount().

final Firm employer [private]

The employer of this WorkContract.

Definition at line 83 of file WorkContract.java.

Referenced by WorkContract.WorkContract().


The documentation for this class was generated from the following file:
Generated on Tue Sep 14 11:11:49 2010 for lagom_generiC by  doxygen 1.5.4