com.h20.course.tp4
Class EntryImpl

java.lang.Object
  extended by com.h20.course.tp4.EntryImpl
All Implemented Interfaces:
Entry

public class EntryImpl
extends java.lang.Object
implements Entry

This is an implementation of the Location interface.

Author:
fpereira

Constructor Summary
EntryImpl(java.lang.String namep, java.lang.String phonep)
          Constructor.
 
Method Summary
 void addLabel(java.lang.String label)
          Adds one label to this entry.
 void delLabel(java.lang.String label)
          This method removes a given label from this entry.
 java.util.Set<java.lang.String> getLabels()
          Returns the list of labels that distinguish this entry.
 java.lang.String getName()
          Informs the name of the person who owns this telephone number.
 java.lang.String getPhone()
          Informs the phone number.
 java.lang.String toString()
          Returns a textual representation of this object, following the pattern: name - type, (latitude, longitude).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EntryImpl

public EntryImpl(java.lang.String namep,
                 java.lang.String phonep)
Constructor.

Parameters:
namep - the name of the person who owns the phone number.
phonep - the phone number itself.
Method Detail

getName

public final java.lang.String getName()
Informs the name of the person who owns this telephone number.

Specified by:
getName in interface Entry
Returns:
a string object.

getPhone

public final java.lang.String getPhone()
Informs the phone number.

Specified by:
getPhone in interface Entry
Returns:
a string object.

toString

public final java.lang.String toString()
Returns a textual representation of this object, following the pattern: name - type, (latitude, longitude).

Overrides:
toString in class java.lang.Object
Returns:
a string object.

getLabels

public final java.util.Set<java.lang.String> getLabels()
Returns the list of labels that distinguish this entry.

Specified by:
getLabels in interface Entry
Returns:
a list of strings representing labels.

addLabel

public final void addLabel(java.lang.String label)
Adds one label to this entry.

Specified by:
addLabel in interface Entry
Parameters:
label - the new label that will be marking this entry.

delLabel

public final void delLabel(java.lang.String label)
This method removes a given label from this entry.

Specified by:
delLabel in interface Entry
Parameters:
label - the label that will be removed. Nothing will happen if this label is not part of this entry.