public class IPAddressMap<TYPE> extends HashMap<String,TYPE>
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
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
IPAddressMap()
Construct empty IPAddressMap.
|
IPAddressMap(int capacity)
Construct empty IPAddressMap.
|
Modifier and Type | Method and Description |
---|---|
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
|
clear, clone, containsKey, containsValue, entrySet, isEmpty, keySet, putAll, remove, size, values
equals, hashCode, toString
public IPAddressMap()
public IPAddressMap(int capacity)
capacity
- initial capacitypublic TYPE put(String addrSpec, TYPE object) throws IllegalArgumentException
put
in interface Map<String,TYPE>
put
in class HashMap<String,TYPE>
IllegalArgumentException
HashMap.put(java.lang.Object, java.lang.Object)
public TYPE get(Object key)
public TYPE match(String addr)
addr
- internet addresspublic Map.Entry<String,TYPE> getMatch(String addr)
addr
- internet addressCopyright © 1995-2015 Webtide. All Rights Reserved.