package com.h20.course.tp1;

/**
 * This is an implementation of the Location interface.
 *
 * @author fpereira
 *
 */
public class EntryImpl implements Entry {

  /**
   * The name of this location. E.g.: "Farmacia Central".
   */
  private final String name;

  /**
   * The type of this location: pharmacy, gas station or bakery.
   */
  private final String phone;

  /**
   * Constructor.
   *
   * @param namep
   *        the name of the person who owns the phone number.
   * @param phonep
   *        the phone number itself.
   */
  public EntryImpl(final String namep, final String phonep) {
    name = namep;
    phone = phonep;
  }

  /**
   * Informs the name of the person who owns this telephone number.
   *
   * @return a string object.
   */
  public final String getName() {
    return name;
  }

  /**
   * Informs the phone number.
   *
   * @return a string object.
   */
  public final String getPhone() {
    return phone;
  }

  /**
   * Returns a textual representation of this object, following the pattern:
   * name - type, (latitude, longitude).
   *
   * @return a string object.
   */
  public final String toString() {
    return name + ": " + phone;
  }

}
