Code example for LinkedListMultimap

Methods: entries

0
  /** 
   * Evict the oldest entry in the cache. 
   */ 
  private synchronized void evictOldest() { 
    Iterator<Entry<SocketAddress, Socket>> iter =
      multimap.entries().iterator();
    if (!iter.hasNext()) {
      throw new IllegalStateException("Cannot evict from empty cache!");
    } 
    Entry<SocketAddress, Socket> entry = iter.next();
    iter.remove();
    Socket sock = entry.getValue();
    IOUtils.closeSocket(sock);
  } 
 
  /** 
   * Empty the cache, and close all sockets. 
   */ 
  public synchronized void clear() { 
    for (Socket sock : multimap.values()) {
Contextual code suggestions in your IDE  Get Codota for Java