next up previous
Next: The class ApartmentOwner: realization Up: Unit 07 Previous: The class ApartmentOwner: representation

The class ApartmentOwner: public interface

We can now choose the interface of the class, through which the clients can make use of the objects of the class ApartmentOwner. Specifically, for each functionality we have to define a public method that realizes it and determine its header.

This leads us to the following skeleton for the class ApartmentOwner:

public class ApartmentOwner {
  // representation of the objects of the class
  private String   owner;
  private String[] apartments;

  // public methods that realize the requested functionalities
  public ApartmentOwner(String name) { ... }
  public String getOwner() { ... }
  public String getApartment(int slot) { ... }
  public void setApartment(String address, int slot) { ... }
  public int countApartments() { ... }
  public void reorganizeApartments() { ... }
  public String toString() { ... }
}


next up previous
Next: The class ApartmentOwner: realization Up: Unit 07 Previous: The class ApartmentOwner: representation