Package sc2002.FCS1.grp2
Class EnquiriesSystem
Object
EnquiriesSystem
Handles all enquiry related processes for a user.
It must be constructed only on login, and destroyed on logout.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEnquiry(Enquiry enquiry) Add an enquiry to the systemprivate StringbuildMenuItem(int index, Enquiry enquiry) Build a menu item ready for display later on.voidDisplay applicable menu itemsGet all enquiries of system, self and respondable (if access control allows)Retrieve a list of enquiries that are respondable by a manager or officer.intSize of own enquiries listvoidremoveEnquiry(Enquiry enquiry) Remove an enquiry.voidsetDelegate(EnquiriesDelegate delegate) Set the delegate objectvoidupdateEnquiry(Enquiry enquiry, String updatedQuestion) Update the enquiry.private voidAlways call this after a list mutative action.
-
Field Details
-
delegate
-
ownEnquiries
-
respondableEnquiries
-
-
Constructor Details
-
EnquiriesSystem
EnquiriesSystem(EnquiriesDelegate delegate)
-
-
Method Details
-
setDelegate
Set the delegate object- Parameters:
delegate- The delegate object
-
addEnquiry
Add an enquiry to the system- Throws:
Exception
-
getEnquiries
Get all enquiries of system, self and respondable (if access control allows)- Returns:
- list of enquiries.
-
getRespondableEnquiries
Retrieve a list of enquiries that are respondable by a manager or officer.- Returns:
- list of enquiries.
-
removeEnquiry
Remove an enquiry.- Parameters:
enquiry- The enquiry to be removed.- Throws:
Exception- access control.
-
updateEnquiry
Update the enquiry.- Parameters:
enquiry- The enquiry to be updated.updatedQuestion- The new question to be updated to.- Throws:
Exception- access control.
-
updateState
private void updateState()Always call this after a list mutative action. -
ownEnquiriesSize
public int ownEnquiriesSize()Size of own enquiries list -
buildMenuItem
Build a menu item ready for display later on.- Parameters:
index- This item's indexenquiry- The enquiry that this represents- Returns:
- string value that represents a menu item.
-
displayEnquiriesMenu
public void displayEnquiriesMenu()Display applicable menu items
-