Class EventManager

java.lang.Object
theLocalLoop.EventManager

public class EventManager extends Object
EventManager class handles the management of events in the application.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    addEvent(LinkedList<Event> events, Scanner input)
    Handles user choice for adding a new event, then prompts user for event details and adds new event to the list.
    static void
    Handles user choice for how they want to delete an event, then prompts user for the name of the event they want to delete Deletes it from the list if found (after confirming password, if applicable).
    static void
    Handles user choice for how they want to display events based on time frame, then displays results.
    static void
    displayEvents(int displayChoice, LinkedList<Event> events, Scanner input)
    Displays events based on the user's choice of time frame.
    static void
    editEvent(LinkedList<Event> events, Scanner input)
    Handles user choice for how they want to edit an event, then prompts user for the name of the event they want to edit and the details they want to edit, then updates the event with the new details.
    static void
    Handles user choice for how they want to filter and sort events, then displays results based on their choices.
    static void
    Handles user choice for how they want to search for an event by name, then displays results.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • displayChoice

      public static void displayChoice(LinkedList<Event> events, Scanner input)
      Handles user choice for how they want to display events based on time frame, then displays results.
      Parameters:
      events - LinkedList of Event objects representing the list of events to display from.
      input - Scanner object for getting user input.
    • displayEvents

      public static void displayEvents(int displayChoice, LinkedList<Event> events, Scanner input)
      Displays events based on the user's choice of time frame.
      Parameters:
      displayChoice - Integer representing the user's choice for how they want to filter events by time frame (1: Today, 2: This Week, 3: This Month, 4: Later Date, 5: All Events).
      events - LinkedList of Event objects representing the list of events to display from.
      input - Scanner object for getting user input in case they choose to filter by a later date (displayChoice 4).
    • searchEvents

      public static void searchEvents(LinkedList<Event> events, Scanner input)
      Handles user choice for how they want to search for an event by name, then displays results.
      Parameters:
      events - LinkedList of Event objects representing the list of events to search from.
      input - Scanner object for getting user input for the name of the event they want to search for.
    • filterAndSortEvents

      public static void filterAndSortEvents(LinkedList<Event> events, Scanner input)
      Handles user choice for how they want to filter and sort events, then displays results based on their choices.
      Parameters:
      events - LinkedList of Event objects representing the list of events to filter and sort from.
      input - Scanner object for getting user input for how they want to filter and sort events.
    • addEvent

      public static void addEvent(LinkedList<Event> events, Scanner input)
      Handles user choice for adding a new event, then prompts user for event details and adds new event to the list.
      Parameters:
      events - LinkedList of Event objects representing the list of events to add the new event to.
      input - Scanner object for getting user input for the details of the new event they want to add.
    • editEvent

      public static void editEvent(LinkedList<Event> events, Scanner input)
      Handles user choice for how they want to edit an event, then prompts user for the name of the event they want to edit and the details they want to edit, then updates the event with the new details.
      Parameters:
      events - LinkedList of Event objects representing the list of events to search from and edit the specified event from.
      input - Scanner object for getting user input for the name of event, the details they want to edit, and the new details to update the event with.
    • deleteEvent

      public static void deleteEvent(LinkedList<Event> events, Scanner input)
      Handles user choice for how they want to delete an event, then prompts user for the name of the event they want to delete Deletes it from the list if found (after confirming password, if applicable).
      Parameters:
      events - LinkedList of Event objects representing the list of events to search from and delete the specified event from.
      input - Scanner object for getting user input for the name of event and password (if applicable).