/**
   * Notifies the <tt>ContactQueryListener</tt>s registered with this <tt>ContactQuery</tt> that its
   * state has changed.
   *
   * @param eventType the type of the <tt>ContactQueryStatusEvent</tt> to be fired which can be one
   *     of the <tt>QUERY_XXX</tt> constants defined by <tt>ContactQueryStatusEvent</tt>
   */
  protected void fireQueryStatusChanged(int eventType) {
    ContactQueryListener[] ls;

    synchronized (listeners) {
      ls = listeners.toArray(new ContactQueryListener[listeners.size()]);
    }

    ContactQueryStatusEvent ev = new ContactQueryStatusEvent(this, eventType);

    for (ContactQueryListener l : ls) l.queryStatusChanged(ev);
  }
  /**
   * Notifies the <tt>ContactQueryListener</tt>s registered with this <tt>ContactQuery</tt> that a
   * <tt>SourceContact</tt> has been changed.
   *
   * @param contact the <tt>SourceContact</tt> which has been changed and which the registered
   *     <tt>ContactQueryListener</tt>s are to be notified about
   */
  protected void fireContactChanged(SourceContact contact) {
    ContactQueryListener[] ls;

    synchronized (listeners) {
      ls = listeners.toArray(new ContactQueryListener[listeners.size()]);
    }

    ContactChangedEvent ev = new ContactChangedEvent(this, contact);

    for (ContactQueryListener l : ls) l.contactChanged(ev);
  }
  /**
   * Notifies the <tt>ContactQueryListener</tt>s registered with this <tt>ContactQuery</tt> that a
   * new <tt>SourceContact</tt> has been received.
   *
   * @param contact the <tt>SourceContact</tt> which has been received and which the registered
   *     <tt>ContactQueryListener</tt>s are to be notified about
   * @param showMoreEnabled indicates whether show more label should be shown or not.
   */
  protected void fireContactReceived(SourceContact contact, boolean showMoreEnabled) {
    ContactQueryListener[] ls;

    synchronized (listeners) {
      ls = listeners.toArray(new ContactQueryListener[listeners.size()]);
    }

    ContactReceivedEvent ev = new ContactReceivedEvent(this, contact, showMoreEnabled);

    for (ContactQueryListener l : ls) {
      l.contactReceived(ev);
    }
  }