Class Dormitory

java.lang.Object
com.montytskyi.Residences.Implementations.Dormitory
All Implemented Interfaces:
ResidenceServiceable

public class Dormitory extends Object implements ResidenceServiceable
The class which represents the Dormitory which will be managed by the system. The Dormitory class is implemented from the ResidenceServiceable interface.
  • Constructor Summary

    Constructors
    Constructor
    Description
    An empty constructor of the Dormitory class
    Dormitory(List<Rentable> rents, List<Administrator> admins, List<Liveable> places)
    A constructor that receives all the parameters possible
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    An implemented method from the interface ResidenceServiceable which allows to add an administrator for the specific Dormitory
    void
    An implemented method from the interface ResidenceServiceable which allows to add a rentable place to the dormitory
    void
    An implemented method from the interface ResidenceServiceable which allows to add a rent to the dormitory
    A getter method which allows to get the collection of the administrators
    A getter method which return the list of places which are the part of the dormitory
    A getter method which returns the list of existing rents in the dormitory
    void
    An implemented method from the interface ResidenceServiceable which allows to remove an administrator from the specific Dormitory
    void
    An implemented method from the interface ResidenceServiceable which allows to add remove an existing in the dormitory place
    void
    An implemented method from the interface ResidenceServiceable which allows to remove an existing rent from the dormitory
    void
    A setter method which allows to set the collection of the administrators for the dormitory
    void
    A setter method which sets the list of places which are the part of the dormitory
    void
    A setter method which sets the collection of rents which will be contained in the Dormitory

    Methods inherited from class java.lang.Object

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

    • Dormitory

      public Dormitory(List<Rentable> rents, List<Administrator> admins, List<Liveable> places)
      A constructor that receives all the parameters possible
      Parameters:
      rents - - the collection of rents which is in charge of containing the dormitory rents
      admins - - the collection of administrators which is responsible of containing the dormitory administrators
      places - - the collection of places which is responsible of containing all the dormitory renting places
    • Dormitory

      public Dormitory()
      An empty constructor of the Dormitory class
  • Method Details

    • addRent

      public void addRent(Rentable rent)
      An implemented method from the interface ResidenceServiceable which allows to add a rent to the dormitory
      Specified by:
      addRent in interface ResidenceServiceable
      Parameters:
      rent - - represents a rent made by an user
    • removeRent

      public void removeRent(Rentable rent)
      An implemented method from the interface ResidenceServiceable which allows to remove an existing rent from the dormitory
      Specified by:
      removeRent in interface ResidenceServiceable
      Parameters:
      rent - - represent a rent made by an user
    • addPlace

      public void addPlace(Liveable place)
      An implemented method from the interface ResidenceServiceable which allows to add a rentable place to the dormitory
      Specified by:
      addPlace in interface ResidenceServiceable
      Parameters:
      place - - represents a place which is able to be rented by an user
    • removePlace

      public void removePlace(Liveable place)
      An implemented method from the interface ResidenceServiceable which allows to add remove an existing in the dormitory place
      Specified by:
      removePlace in interface ResidenceServiceable
      Parameters:
      place - - represents a place which is able to be rented by an user
    • addAdministrator

      public void addAdministrator(Administrator admin)
      An implemented method from the interface ResidenceServiceable which allows to add an administrator for the specific Dormitory
      Specified by:
      addAdministrator in interface ResidenceServiceable
      Parameters:
      admin - - the administrator who will be in charge of the specific residence
    • removeAdministrator

      public void removeAdministrator(Administrator admin)
      An implemented method from the interface ResidenceServiceable which allows to remove an administrator from the specific Dormitory
      Specified by:
      removeAdministrator in interface ResidenceServiceable
      Parameters:
      admin - - the administrator that should be removed from the specific residence
    • getRents

      public List<Rentable> getRents()
      A getter method which returns the list of existing rents in the dormitory
      Returns:
      rents - list of existing rents in the dormitory
    • setRents

      public void setRents(List<Rentable> rents)
      A setter method which sets the collection of rents which will be contained in the Dormitory
      Parameters:
      rents - - list of rents in the dormitory
    • getAdmins

      public List<Administrator> getAdmins()
      A getter method which allows to get the collection of the administrators
      Returns:
      admins - the list of existing administrator in the dormitory
    • setAdmins

      public void setAdmins(List<Administrator> admins)
      A setter method which allows to set the collection of the administrators for the dormitory
      Parameters:
      admins - - the list of administrators of the specific dormitory
    • getPlaces

      public List<Liveable> getPlaces()
      A getter method which return the list of places which are the part of the dormitory
      Returns:
      places - the list of places in the dormitory which can be rented by some client
    • setPlaces

      public void setPlaces(List<Liveable> places)
      A setter method which sets the list of places which are the part of the dormitory
      Parameters:
      places - - the list of places in the dormitory which can be rented by some client