Code example for ArrayList

Methods: add, contains

0
    return lastKnownLocations.get(provider);
  } 
 
  @Implementation 
  public boolean addGpsStatusListener(Listener listener) {
    if (!gpsStatusListeners.contains(listener)) {
      gpsStatusListeners.add(listener);
    } 
    return true; 
  } 
 
  @Implementation 
  public void removeGpsStatusListener(Listener listener) {
    gpsStatusListeners.remove(listener);
  } 
 
  /** 
   * Returns the best provider with respect to the passed criteria (if any) and its status. If no criteria are passed 
   * 
   * NB: Gps is considered the best provider for fine accuracy and high power consumption, network is considered the 
   * best provider for coarse accuracy and low power consumption.