org.apache.wicket.util.collections
Class MicroMap
java.lang.Object
org.apache.wicket.util.collections.MicroMap
- All Implemented Interfaces:
- java.io.Serializable, java.util.Map
public final class MicroMap
- extends java.lang.Object
- implements java.util.Map, java.io.Serializable
An implementation of the java.util.Map interface which can only hold a single object. This is
particularly useful to control memory usage in Wicket because many containers hold only a single
component.
- Author:
- Jonathan Locke
- See Also:
- Serialized Form
Nested classes/interfaces inherited from interface java.util.Map |
java.util.Map.Entry<K,V> |
Field Summary |
static int |
MAX_ENTRIES
The maximum number of entries this map supports. |
Constructor Summary |
MicroMap()
Constructor |
MicroMap(java.lang.Object key,
java.lang.Object value)
Constructs map with a single key and value pair. |
Method Summary |
void |
clear()
|
boolean |
containsKey(java.lang.Object key)
|
boolean |
containsValue(java.lang.Object value)
|
java.util.Set |
entrySet()
|
java.lang.Object |
get(java.lang.Object key)
|
boolean |
isEmpty()
|
boolean |
isFull()
|
java.util.Set |
keySet()
|
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
|
void |
putAll(java.util.Map map)
|
java.lang.Object |
remove(java.lang.Object key)
|
int |
size()
|
java.util.Collection |
values()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Map |
equals, hashCode |
MAX_ENTRIES
public static final int MAX_ENTRIES
- The maximum number of entries this map supports.
- See Also:
- Constant Field Values
MicroMap
public MicroMap()
- Constructor
MicroMap
public MicroMap(java.lang.Object key,
java.lang.Object value)
- Constructs map with a single key and value pair.
- Parameters:
key
- The keyvalue
- The value
isFull
public boolean isFull()
- Returns:
- True if this MicroMap is full
size
public int size()
- Specified by:
size
in interface java.util.Map
- See Also:
Map.size()
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interface java.util.Map
- See Also:
Map.isEmpty()
containsKey
public boolean containsKey(java.lang.Object key)
- Specified by:
containsKey
in interface java.util.Map
- See Also:
Map.containsKey(java.lang.Object)
containsValue
public boolean containsValue(java.lang.Object value)
- Specified by:
containsValue
in interface java.util.Map
- See Also:
Map.containsValue(java.lang.Object)
get
public java.lang.Object get(java.lang.Object key)
- Specified by:
get
in interface java.util.Map
- See Also:
Map.get(java.lang.Object)
put
public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
- Specified by:
put
in interface java.util.Map
- See Also:
Map.put(java.lang.Object, java.lang.Object)
remove
public java.lang.Object remove(java.lang.Object key)
- Specified by:
remove
in interface java.util.Map
- See Also:
Map.remove(java.lang.Object)
putAll
public void putAll(java.util.Map map)
- Specified by:
putAll
in interface java.util.Map
- See Also:
Map.putAll(java.util.Map)
clear
public void clear()
- Specified by:
clear
in interface java.util.Map
- See Also:
Map.clear()
keySet
public java.util.Set keySet()
- Specified by:
keySet
in interface java.util.Map
- See Also:
Map.keySet()
values
public java.util.Collection values()
- Specified by:
values
in interface java.util.Map
- See Also:
Map.values()
entrySet
public java.util.Set entrySet()
- Specified by:
entrySet
in interface java.util.Map
- See Also:
Map.entrySet()
Copyright © 2004-2010 Apache Software Foundation. All Rights Reserved.