org.eclipse.jetty.util
Class IPAddressMap<TYPE>

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<String,TYPE>
          extended by org.eclipse.jetty.util.IPAddressMap<TYPE>
All Implemented Interfaces:
Serializable, Cloneable, Map<String,TYPE>

public class IPAddressMap<TYPE>
extends HashMap<String,TYPE>

Internet address map to object

Internet addresses may be specified as absolute address or as a combination of four octet wildcard specifications (a.b.c.d) that are defined as follows.

 nnn - an absolute value (0-255)
 mmm-nnn - an inclusive range of absolute values, 
           with following shorthand notations:
           nnn- => nnn-255
           -nnn => 0-nnn
           -    => 0-255
 a,b,... - a list of wildcard specifications
 

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Constructor Summary
IPAddressMap()
          Construct empty IPAddressMap.
IPAddressMap(int capacity)
          Construct empty IPAddressMap.
 
Method Summary
 TYPE get(Object key)
          Retrieve the object mapped to the specified internet address literal
 Object getLazyMatches(String addr)
          Retrieve a lazy list of map entries associated with specified internet address by taking into account the wildcard specifications.
 Map.Entry<String,TYPE> getMatch(String addr)
          Retrieve the first map entry that is associated with the specified internet address by taking into account the wildcard specifications.
 TYPE match(String addr)
          Retrieve the first object that is associated with the specified internet address by taking into account the wildcard specifications.
 TYPE put(String addrSpec, TYPE object)
          Insert a new internet address into map
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, isEmpty, keySet, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

IPAddressMap

public IPAddressMap()
Construct empty IPAddressMap.


IPAddressMap

public IPAddressMap(int capacity)
Construct empty IPAddressMap.

Parameters:
capacity - initial capacity
Method Detail

put

public TYPE put(String addrSpec,
                TYPE object)
         throws IllegalArgumentException
Insert a new internet address into map

Specified by:
put in interface Map<String,TYPE>
Overrides:
put in class HashMap<String,TYPE>
Throws:
IllegalArgumentException
See Also:
HashMap.put(java.lang.Object, java.lang.Object)

get

public TYPE get(Object key)
Retrieve the object mapped to the specified internet address literal

Specified by:
get in interface Map<String,TYPE>
Overrides:
get in class HashMap<String,TYPE>
See Also:
HashMap.get(java.lang.Object)

match

public TYPE match(String addr)
Retrieve the first object that is associated with the specified internet address by taking into account the wildcard specifications.

Parameters:
addr - internet address
Returns:
associated object

getMatch

public Map.Entry<String,TYPE> getMatch(String addr)
Retrieve the first map entry that is associated with the specified internet address by taking into account the wildcard specifications.

Parameters:
addr - internet address
Returns:
map entry associated

getLazyMatches

public Object getLazyMatches(String addr)
Retrieve a lazy list of map entries associated with specified internet address by taking into account the wildcard specifications.

Parameters:
addr - internet address
Returns:
lazy list of map entries


Copyright © 1995-2011 Mort Bay Consulting. All Rights Reserved.