Class EnquiriesSystem

Object
EnquiriesSystem

public class EnquiriesSystem extends Object
Handles all enquiry related processes for a user. It must be constructed only on login, and destroyed on logout.
  • Field Details

  • Constructor Details

  • Method Details

    • setDelegate

      public void setDelegate(EnquiriesDelegate delegate)
      Set the delegate object
      Parameters:
      delegate - The delegate object
    • addEnquiry

      public void addEnquiry(Enquiry enquiry) throws Exception
      Add an enquiry to the system
      Throws:
      Exception
    • getEnquiries

      public List<Enquiry> getEnquiries()
      Get all enquiries of system, self and respondable (if access control allows)
      Returns:
      list of enquiries.
    • getRespondableEnquiries

      public List<Enquiry> getRespondableEnquiries()
      Retrieve a list of enquiries that are respondable by a manager or officer.
      Returns:
      list of enquiries.
    • removeEnquiry

      public void removeEnquiry(Enquiry enquiry) throws Exception
      Remove an enquiry.
      Parameters:
      enquiry - The enquiry to be removed.
      Throws:
      Exception - access control.
    • updateEnquiry

      public void updateEnquiry(Enquiry enquiry, String updatedQuestion) throws Exception
      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

      private String buildMenuItem(int index, Enquiry enquiry)
      Build a menu item ready for display later on.
      Parameters:
      index - This item's index
      enquiry - The enquiry that this represents
      Returns:
      string value that represents a menu item.
    • displayEnquiriesMenu

      public void displayEnquiriesMenu()
      Display applicable menu items