java.net
Class InetAddress.Cache

java.lang.Object
  extended byjava.net.InetAddress.Cache
Enclosing class:
InetAddress

static final class InetAddress.Cache
extends Object

A cache that manages entries based on a policy specified at creation time.


Field Summary
private  LinkedHashMap cache
           
private  int policy
           
 
Constructor Summary
InetAddress.Cache(int policy)
          Create cache with specific policy
 
Method Summary
 InetAddress.CacheEntry get(String host)
          Query the cache for the specific host.
 InetAddress.Cache put(String host, Object address)
          Add an entry to the cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

policy

private int policy

cache

private LinkedHashMap cache
Constructor Detail

InetAddress.Cache

public InetAddress.Cache(int policy)
Create cache with specific policy

Method Detail

put

public InetAddress.Cache put(String host,
                             Object address)
Add an entry to the cache. If there's already an entry then for this host then the entry will be replaced.


get

public InetAddress.CacheEntry get(String host)
Query the cache for the specific host. If found then return its CacheEntry, or null if not found.