Package wt.fc.collections
Class WTKeyedHashMap
java.lang.Object
java.util.AbstractMap
wt.fc.collections.WTKeyedHashMap
- All Implemented Interfaces:
Externalizable,Serializable,Cloneable,Map,WTKeyedMap,ResultProcessor,Evolvable
- Direct Known Subclasses:
WTValuedHashMap
public class WTKeyedHashMap
extends AbstractMap
implements Cloneable, WTKeyedMap, ResultProcessor, Evolvable
Follows the patterns established by the default collection implementations.
The implementation of ResultProcessor.addElement(Object) uses the following
algorithm:
- If the object is a Persistable, puts it in the map with a null value
- If the object is a 2-element array of Persistables, adds them as a key/value pair
- If the object is a 2-element array of String,Number, then creates a QueryKey and puts it in the map with a null value
- If the object is a 4-element array of String,Number,String,Number, then creates a QueryKey for each pair and adds them as a key/value pair
Note: this class is Evolvable. Remember: anything you put into
the database needs to be able to come back out later (perhaps much
later. You will especially want to think twice before blobbing this map
because the values can be anything, including instances of classes
you have no control over. See also other warnings related to evolvable
collections (such as WTValuedHashMap's warning.
Supported API: true
Extendable: false
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Constructor Summary
ConstructorsConstructorDescription
Supported API: trueWTKeyedHashMap(int initial_capacity)
Supported API: trueWTKeyedHashMap(int initial_capacity, int key_mask)
Supported API: true
Supported API: trueWTKeyedHashMap(Map m, int key_mask)
Supported API: true -
Method Summary
Methods inherited from class java.util.AbstractMap
toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
WTKeyedHashMap
public WTKeyedHashMap()
Supported API: true -
WTKeyedHashMap
public WTKeyedHashMap(int initial_capacity)
Supported API: true- Parameters:
initial_capacity-
-
WTKeyedHashMap
public WTKeyedHashMap(int initial_capacity, int key_mask)
Supported API: true- Parameters:
initial_capacity-key_mask-
-
WTKeyedHashMap
Supported API: true- Parameters:
m-
-
WTKeyedHashMap
Supported API: true- Parameters:
m-key_mask-
-
-
Method Details
-
clone
Supported API: true- Overrides:
clonein classAbstractMap- Returns:
- Object
-
clone
Supported API: true- Parameters:
deep-- Returns:
- WTKeyedHashMap
-