for (int i = 0; i < nListeners; i++) { if (record.equals(listeners[i])) { return; } } listeners [nListeners++] = record;
listeners.add(record); nListeners = listeners.size();
  public final void addEventListener(String type,                                     EventListener listener,                                     boolean useCapture)  {    if (listeners == null)      {        listeners = new ListenerRecord[1];      }    else if (nListeners == listeners.length)      {        ListenerRecord[] newListeners =          new ListenerRecord[listeners.length + NKIDS_DELTA];        System.arraycopy(listeners, 0, newListeners, 0, nListeners);        listeners = newListeners;      }    // prune duplicates    ListenerRecord record;    record = new ListenerRecord(type, listener, useCapture);    for (int i = 0; i < nListeners; i++)      {        if (record.equals(listeners[i]))          {            return;          }      }    listeners [nListeners++] = record;  }