|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectclubs.FuneralClub
public class FuneralClub
Handles the working of the Funeral Club/Burial Society
Field Summary | |
---|---|
private int |
capacity
Capacity of the funeral club |
private int |
currentFunds
current funds of the funeral clubs |
private int |
id
club id |
private int |
initialFunds
Initial funds to start the funeral clubs |
private java.util.ArrayList<Household> |
members
Members of the funeral clubs |
private java.util.ArrayList<Household> |
requests
Requests to join the funeral clubs |
Constructor Summary | |
---|---|
FuneralClub()
Default constructor |
|
FuneralClub(int _id)
Creates funeral club with _id |
Method Summary | |
---|---|
void |
addContribution(int money)
add contribution to the fund |
void |
addMember(Household _member)
Add household as member |
int |
getCurrentFunds()
Returns current funds of the funeral club |
int |
getId()
Returns id of the funeral club |
java.util.ArrayList<Household> |
getMembers()
Returns members of the funeral club |
boolean |
handleRequestMembership()
If membership less than capacity |
void |
pay(Household household,
int share)
Household pays its share |
void |
removeMember(Household _member)
Remove household from the funeral club |
void |
request(Household household)
If a households defaults for some time and doesn't pay, then it doesn't get any help from the club, anymore after a grace period. |
void |
setCurrentFunds(int currentFunds)
Sets current funds of the funeral club |
void |
setId(int id)
Sets id of the funeral club |
void |
setMembers(java.util.ArrayList<Household> members)
Sets members of the funeral club |
void |
step()
Funeral clubs/burial societies give full amount to some, and a bit proportion of the rest pool to the others who've suffered a breavement. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private int id
private int initialFunds
private int currentFunds
private java.util.ArrayList<Household> members
private java.util.ArrayList<Household> requests
private int capacity
Constructor Detail |
---|
public FuneralClub()
public FuneralClub(int _id)
_id
- Method Detail |
---|
public int getCurrentFunds()
public void setCurrentFunds(int currentFunds)
currentFunds
- public int getId()
public void setId(int id)
id
- public java.util.ArrayList<Household> getMembers()
public void setMembers(java.util.ArrayList<Household> members)
members
- public void addMember(Household _member)
_member
- public void removeMember(Household _member)
_member
- public void addContribution(int money)
money
- public boolean handleRequestMembership()
public void step()
public void pay(Household household, int share)
household
- share
- public void request(Household household)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |