Class CitizenEditProfileMemento

java.lang.Object
com.prog3.ipt.Model.CitizenClasses.CitizenEditProfileMemento

public class CitizenEditProfileMemento extends Object
CitizenEditProfileMemento is a class, created to implement Memento object included into Memento Method design pattern.
  • Field Details

  • Constructor Details

    • CitizenEditProfileMemento

      public CitizenEditProfileMemento()
  • Method Details

    • addState

      public void addState(Citizen newCitizen)
      Add a reference to a Citizen into a LinkedList object
      Parameters:
      newCitizen - Object which represents data of one of the citizens registered into system
    • getCitizensData

      private LinkedList<Citizen> getCitizensData()
      Returns a LinkedList object
      Returns:
      A reference to a LinkedList object
    • getLastCitizenData

      public Citizen getLastCitizenData()
      Returns a Citizen object or null if linked list is empty
      Returns:
      references to a Citizen object or null