public static class RestrictedCollections.RestrictedMap extends Base implements Map, Serializable
Base.LoggingWriter, Base.StackFrame
Modifier and Type | Field and Description |
---|---|
protected Class |
m_clzKey
The class of key stored in the Map.
|
protected Class |
m_clzVal
The class of value stored in the Map.
|
protected Map |
m_map
The underlying Map.
|
protected Set |
m_set
The Entry Set.
|
Constructor and Description |
---|
RestrictedMap(Map map,
Class clzKey,
Class clzVal)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkKey(Object o)
Check the passed object to verify that it passes the "key"
restriction of this Map.
|
protected void |
checkValue(Object o)
Check the passed object to verify that it passes the "value"
restriction of this Map.
|
void |
clear()
Removes all mappings from this map.
|
boolean |
containsKey(Object key)
Returns true if this map contains a mapping for the
specified key.
|
boolean |
containsValue(Object value)
Returns true if this map maps one or more keys to the
specified value.
|
Set |
entrySet()
Returns a set view of the mappings contained in this map.
|
boolean |
equals(Object o)
Compares the specified object with this map for equality.
|
Object |
get(Object key)
Returns the value to which this map maps the specified key.
|
int |
hashCode()
Returns the hash code value for this map.
|
boolean |
isEmpty()
Returns true if this map contains no key-value mappings.
|
Set |
keySet()
Returns a set view of the keys contained in this map.
|
Object |
put(Object key,
Object value)
Associates the specified value with the specified key in this map.
|
void |
putAll(Map map)
Copies all of the mappings from the specified map to this map.
|
Object |
remove(Object key)
Removes the mapping for this key from this map if present.
|
int |
size()
Returns the number of key-value mappings in this map.
|
String |
toString()
Return a String description for this Map.
|
Collection |
values()
Returns a collection view of the values contained in this map.
|
azzert, azzert, azzert, azzertFailed, breakLines, breakLines, capitalize, checkNotEmpty, checkNotNull, checkRange, computeSafeWaitTime, decimalValue, dup, dup, ensureBigDecimal, ensureClassLoader, ensureRuntimeException, ensureRuntimeException, equals, equalsDeep, err, err, err, err, err, escape, formatDateTime, getCallerStackFrame, getCommonMonitor, getCommonMonitor, getCommonMonitor, getContextClassLoader, getContextClassLoader, getDeepMessage, getErr, getLastSafeTimeMillis, getLog, getMaxDecDigits, getMaxHexDigits, getOriginalException, getOut, getProcessRandom, getRandom, getRandomBinary, getRandomBinary, getRandomString, getSafeTimeMillis, getStackFrame, getStackFrames, getStackTrace, getStackTrace, getThreadFactory, getTimeZone, getUpTimeMillis, hashCode, hexValue, indentString, indentString, isDecimal, isHex, isLogEcho, isOctal, log, log, log, log, log, makeInteger, makeLong, makeThread, mod, mod, octalValue, out, out, out, out, out, pad, parseBandwidth, parseBandwidth, parseDelimitedString, parseHex, parseHex, parseMemorySize, parseMemorySize, parsePercentage, parseTime, parseTime, parseTimeNanos, parseTimeNanos, printStackTrace, randomize, randomize, randomize, randomize, read, read, read, read, read, read, read, replace, setErr, setLog, setLogEcho, setOut, sleep, toBandwidthString, toBandwidthString, toCharEscape, toCrc, toCrc, toCrc, toCrc, toCrc, toDecString, toDelimitedString, toDelimitedString, toDelimitedString, toDelimitedString, toHex, toHex, toHexDump, toHexEscape, toHexEscape, toHexEscape, toHexEscape, toHexString, toMemorySizeString, toMemorySizeString, toQuotedCharEscape, toQuotedStringEscape, toSqlString, toString, toString, toStringEscape, toUnicodeEscape, trace, trace, trace, trace, trace, trace, trace, trace, trace, truncateString, truncateString, wait
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
protected Map m_map
protected Class m_clzKey
protected Class m_clzVal
protected Set m_set
public int size()
public boolean isEmpty()
public boolean containsKey(Object key)
containsKey
in interface Map
key
- key whose presence in this map is to be testedpublic boolean containsValue(Object value)
containsValue
in interface Map
value
- value whose presence in this map is to be testedpublic Object get(Object key)
public Object put(Object key, Object value)
put
in interface Map
key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified keyClassCastException
- if the class of the specified key or value
prevents it from being stored in this map.public void putAll(Map map)
putAll
in interface Map
map
- Mappings to be stored in this mapClassCastException
- if the class of a key or value in the
specified map prevents it from being stored in this mappublic Set keySet()
public Collection values()
public Set entrySet()
public boolean equals(Object o)
public int hashCode()
public String toString()
protected void checkKey(Object o)
o
- the Object to checkClassCastException
- if the class of the passed Object
prevents it from being used as a key in this Mapprotected void checkValue(Object o)
o
- the Object to checkClassCastException
- if the class of the passed Object
prevents it from being used as a value in this Map