|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap
wt.fc.collections.WTKeyedHashMap
Follows the patterns established by the default collection implementations. The implementation of ResultProcessor.addElement(Object) uses the following algorithm:
Nested Class Summary | |
(package private) class |
WTKeyedHashMap.EntryIterator
|
(package private) class |
WTKeyedHashMap.EntrySet
|
(package private) class |
WTKeyedHashMap.ExpandableFilteredSet
|
(package private) class |
WTKeyedHashMap.FilteredSet
|
private static class |
WTKeyedHashMap.HashMapProxy
Used to remove mappings from keyMap once a Persistable is stored, since the Persistable's hashCode has changed. |
(package private) class |
WTKeyedHashMap.KeySet
|
(package private) class |
WTKeyedHashMap.PersistableIterator
|
(package private) class |
WTKeyedHashMap.QueryKeyIterator
|
(package private) class |
WTKeyedHashMap.ReferenceIterator
|
(package private) class |
WTKeyedHashMap.Values
|
(package private) class |
WTKeyedHashMap.ValuesIterator
|
(package private) class |
WTKeyedHashMap.WTKeyedEntry
|
Nested classes inherited from class java.util.AbstractMap |
|
Nested classes inherited from class wt.fc.collections.WTKeyedMap |
WTKeyedMap.WTEntry |
Nested classes inherited from class java.util.Map |
Map.Entry |
Field Summary | |
private static String |
CLASSNAME
|
(package private) static int |
DEFAULT_INITIAL_CAPACITY
|
(package private) static int |
DEFAULT_KEY_MASK
|
(package private) static float |
DEFAULT_LOAD_FACTOR
|
private boolean |
deflatedOnSerialization
|
static long |
EXTERNALIZATION_VERSION_UID
|
(package private) HashMap |
keyMap
|
(package private) int |
keyMask
|
(package private) int |
nonPersistedCount
|
protected static long |
OLD_FORMAT_VERSION_UID
|
(package private) ReferenceMap |
referenceMap
|
private static String |
RESOURCE
|
(package private) static long |
serialVersionUID
|
(package private) Set |
wtEntrySet
|
(package private) WTSet |
wtKeySet
|
(package private) Collection |
wtValues
|
Fields inherited from class java.util.AbstractMap |
|
Fields inherited from interface wt.fc.collections.WTKeyedMap |
DEFLATED_ON_SERIALIZATION |
Constructor Summary | |
WTKeyedHashMap()
Supported API: true |
|
WTKeyedHashMap(int initial_capacity)
Supported API: true |
|
WTKeyedHashMap(int initial_capacity,
int key_mask)
Supported API: true |
|
WTKeyedHashMap(Map m)
Supported API: true |
|
WTKeyedHashMap(Map m,
int key_mask)
Supported API: true |
Method Summary | |
void |
addElement(Object anObj)
Add the specified object to the result processor, and increase the size by one Supported API: false |
void |
clear()
Supported API: false |
Object |
clone()
Supported API: true |
WTKeyedHashMap |
clone(boolean deep)
Supported API: true |
Object |
connect(Persistable p,
Object value,
WTKeyedMap source)
Adds the mapping for the given key to this map from the source map. |
Object |
connect(Persistable p,
WTKeyedMap source)
Adds the mapping for the given key to this map from the source map. |
Object |
connect(Persistable p,
WTKeyedMap source,
boolean put_if_not_present)
Adds the mapping for the given key to this map from the source map. |
Object |
connect(QueryKey query_key,
Object value,
WTKeyedMap source)
Connects the given key with the key in source. |
Object |
connect(QueryKey query_key,
WTKeyedMap source)
Adds the mapping for the given key to this map from the source map. |
Object |
connect(QueryKey query_key,
WTKeyedMap source,
boolean put_if_not_present)
Connects the given key with the key in source. |
(package private) Object |
connect(WTReference ref,
Object value,
boolean put_if_not_present)
|
Object |
connect(WTReference ref,
Object value,
WTKeyedMap source)
Connects the given key with the key in source. |
Object |
connect(WTReference ref,
WTKeyedMap source)
Adds the mapping for the given key to this map from the source map. |
Object |
connect(WTReference ref,
WTKeyedMap source,
boolean put_if_not_present)
Adds the mapping for the given key to this map from the source map. |
void |
connectAll(WTKeyedMap source)
Adds the mappings from the source map to this map. |
void |
connectAll(WTKeyedMap source,
boolean put_if_not_present)
Adds the mappings from the source map to this map. |
boolean |
containsKey(Object key)
Supported API: false |
boolean |
containsKey(Persistable p)
Supported API: false |
boolean |
containsKey(QueryKey query_key)
Supported API: false |
boolean |
containsKey(WTReference ref)
Supported API: false |
(package private) boolean |
containsNonPersistedKey(Persistable p)
|
boolean |
containsValue(Object value)
Supported API: false |
(package private) WTKeyedMap.WTEntry |
createEntry(WTReference key)
|
(package private) Set |
createEntrySet()
|
(package private) WTSet |
createKeySet()
|
(package private) ReferenceMap |
createReferenceMap()
|
(package private) Collection |
createValues()
|
(package private) Iterator |
entryIterator()
|
Set |
entrySet()
Supported API: false |
boolean |
equals(Object o)
Supported API: true |
(package private) WTSet |
expandableFilteredSet(Class filter,
boolean include_subclasses,
WTSet source)
|
Object |
get(Object key)
Supported API: false |
Object |
get(Persistable p)
Supported API: true |
Object |
get(QueryKey query_key)
Supported API: false |
Object |
get(WTReference ref)
Supported API: false |
(package private) WTKeyedMap.WTEntry |
getEntry(Persistable p)
|
(package private) WTKeyedMap.WTEntry |
getEntry(QueryKey query_key)
|
(package private) WTKeyedMap.WTEntry |
getEntry(WTReference ref)
|
static int |
getInitialCapacity(int size)
Get the initial capacity that should be used for a new map that is intended to hold the given number of elements. |
int |
getKeyMask()
Supported API: false |
int |
hashCode()
Supported API: false |
boolean |
isDeflatedOnSerialization()
Gets the value of the attribute: deflatedOnSerialization. |
boolean |
isEmpty()
Supported API: true |
boolean |
isEnabled(int mask)
Supported API: false |
Set |
keySet()
Supported API: false |
(package private) Iterator |
persistableIterator()
|
(package private) Iterator |
persistableIterator(Class filter,
boolean include_subclasses)
|
Object |
put(Object key,
Object value)
Supported API: false |
Object |
put(Persistable p,
Object value)
Supported API: false |
Object |
put(QueryKey query_key,
Object value)
Supported API: false |
Object |
put(WTReference ref,
Object value)
Supported API: false |
void |
putAll(Map map)
Supported API: false |
protected void |
putClone(WTKeyedMap.WTEntry e,
boolean deep)
Put a clone of the mapping in the given entry into this map |
(package private) Iterator |
queryKeyIterator()
|
(package private) Iterator |
queryKeyIterator(Class filter,
boolean include_subclasses)
|
void |
readExternal(ObjectInput input)
Reads the non-transient fields of this class from an external source. |
private boolean |
readOldVersion(ObjectInput input,
long readSerialVersionUID,
boolean passThrough,
boolean superDone)
Reads the non-transient fields of this class from an external source, which is not the current version. |
protected boolean |
readVersion(WTKeyedHashMap thisObject,
ObjectInput input,
long readSerialVersionUID,
boolean passThrough,
boolean superDone)
Reads the non-transient fields of this class from an external source. |
(package private) Iterator |
referenceKeyIterator()
|
(package private) Iterator |
referenceKeyIterator(Class filter,
boolean include_subclasses)
|
(package private) WTKeyedMap.WTEntry |
referenceRemoved(WTReference r)
|
Object |
remove(Object key)
Supported API: false |
Object |
remove(Persistable p)
Supported API: false |
Object |
remove(QueryKey query_key)
Supported API: false |
Object |
remove(WTReference ref)
Supported API: false |
(package private) Object |
removeEntry(WTKeyedMap.WTEntry e)
|
(package private) Object |
removeNonPersistedKey(Persistable p)
|
void |
setDeflatedOnSerialization(boolean a_DeflatedOnSerialization)
Sets the value of the attribute: deflatedOnSerialization. |
int |
size()
Supported API: false |
Collection |
values()
Supported API: false |
void |
writeExternal(ObjectOutput output)
Writes the non-transient fields of this class to an external source. |
WTSet |
wtKeySet()
Supported API: false |
Methods inherited from class java.util.AbstractMap |
toString |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final String RESOURCE
private static final String CLASSNAME
private transient boolean deflatedOnSerialization
static final long serialVersionUID
public static final long EXTERNALIZATION_VERSION_UID
protected static final long OLD_FORMAT_VERSION_UID
static final int DEFAULT_INITIAL_CAPACITY
static final int DEFAULT_KEY_MASK
static final float DEFAULT_LOAD_FACTOR
int keyMask
transient int nonPersistedCount
transient volatile HashMap keyMap
transient ReferenceMap referenceMap
transient WTSet wtKeySet
transient Set wtEntrySet
transient Collection wtValues
Constructor Detail |
public WTKeyedHashMap()
public WTKeyedHashMap(int initial_capacity)
initial_capacity
- public WTKeyedHashMap(int initial_capacity, int key_mask)
initial_capacity
- key_mask
- public WTKeyedHashMap(Map m)
m
- public WTKeyedHashMap(Map m, int key_mask)
m
- key_mask
- Method Detail |
public void writeExternal(ObjectOutput output) throws IOException
writeExternal
in interface Externalizable
output
-
IOException
public void readExternal(ObjectInput input) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
input
-
IOException
ClassNotFoundException
protected boolean readVersion(WTKeyedHashMap thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone) throws IOException, ClassNotFoundException
thisObject
- input
- readSerialVersionUID
- passThrough
- superDone
-
IOException
ClassNotFoundException
private boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone) throws IOException, ClassNotFoundException
input
- readSerialVersionUID
- passThrough
- superDone
-
IOException
ClassNotFoundException
public Object clone()
public WTKeyedHashMap clone(boolean deep)
deep
-
public boolean isDeflatedOnSerialization()
isDeflatedOnSerialization
in interface WTKeyedMap
public void setDeflatedOnSerialization(boolean a_DeflatedOnSerialization) throws WTPropertyVetoException
setDeflatedOnSerialization
in interface WTKeyedMap
a_DeflatedOnSerialization
-
WTPropertyVetoException
public void clear()
clear
in interface WTKeyedMap
public Object connect(Persistable p, WTKeyedMap source)
connect
in interface WTKeyedMap
p
- source
-
IllegalArgumentException
- If the source does not have the same
key type as this map.
ClassCastException
- If this map does not support connection
with the source's implementation of WTKeyedMapconnect(Persistable,WTKeyedMap,boolean)
public Object connect(QueryKey query_key, WTKeyedMap source)
connect
in interface WTKeyedMap
query_key
- source
-
IllegalArgumentException
- If the source does not have the same
key type as this map.
ClassCastException
- If this map does not support connection
with the source's implementation of WTKeyedMapconnect(Persistable,WTKeyedMap,boolean)
public Object connect(WTReference ref, WTKeyedMap source)
connect
in interface WTKeyedMap
ref
- source
-
IllegalArgumentException
- If the source does not have the same
key type as this map.
ClassCastException
- If this map does not support connection
with the source's implementation of WTKeyedMapconnect(WTReference,WTKeyedMap,boolean)
public Object connect(Persistable p, WTKeyedMap source, boolean put_if_not_present)
put_if_not_present
is true
, then if the
key does not exist in source, it is mapped to null. Otherwise, when
the key is inflated or refreshed in the source, it is also inflated
or refreshed in this map, and vice versa.
connect
in interface WTKeyedMap
p
- source
- put_if_not_present
-
IllegalArgumentException
- If the source does not have the same
key type as this map.
ClassCastException
- If this map does not support connection
with the source's implementation of WTKeyedMappublic Object connect(WTReference ref, WTKeyedMap source, boolean put_if_not_present)
put_if_not_present
is true
, then if the
key does not exist in source, it is mapped to null. Otherwise, when
the key is inflated or refreshed in the source, it is also inflated
or refreshed in this map, and vice versa.
connect
in interface WTKeyedMap
ref
- source
- put_if_not_present
-
IllegalArgumentException
- If the source does not have the same
key type as this map.
ClassCastException
- If this map does not support connection
with the source's implementation of WTKeyedMappublic Object connect(QueryKey query_key, WTKeyedMap source, boolean put_if_not_present)
put_if_not_present
is true
, then if the key does not exist in source, it
is mapped to null. Otherwise, when the key is inflated or refreshed
in the source, it is also inflated or refreshed in this map, and vice
versa.
connect
in interface WTKeyedMap
query_key
- source
- put_if_not_present
-
IllegalArgumentException
- If the source does not have the same
key type as this map.
ClassCastException
- If this map does not support connection
with the source's implementation of WTKeyedMappublic Object connect(Persistable p, Object value, WTKeyedMap source)
connect
in interface WTKeyedMap
p
- value
- source
-
IllegalArgumentException
- If the source does not have the same
key type as this map.
ClassCastException
- If this map does not support connection
with the source's implementation of WTKeyedMappublic Object connect(QueryKey query_key, Object value, WTKeyedMap source)
connect
in interface WTKeyedMap
query_key
- value
- source
-
IllegalArgumentException
- If the source does not have the same
key type as this map.
ClassCastException
- If this map does not support connection
with the source's implementation of WTKeyedMappublic Object connect(WTReference ref, Object value, WTKeyedMap source)
connect
in interface WTKeyedMap
ref
- value
- source
-
IllegalArgumentException
- If the source does not have the same
key type as this map.
ClassCastException
- If this map does not support connection
with the source's implementation of WTKeyedMappublic void connectAll(WTKeyedMap source)
connectAll
in interface WTKeyedMap
source
-
IllegalArgumentException
- If source does not have the same
key type as this map
ClassCastException
- If this map does not support connection
with source's implementation of WTKeyedMap.connectAll(WTKeyedMap,boolean)
public void connectAll(WTKeyedMap source, boolean put_if_not_present)
put_if_not_present
is true
, then mappings in the source map that don't exist
in this map are added to this map.
connectAll
in interface WTKeyedMap
source
- put_if_not_present
-
IllegalArgumentException
- If source does not have the same
key type as this map
ClassCastException
- If this map does not support connection
with source's implementation of WTKeyedMap.public boolean containsKey(Object key)
containsKey
in interface WTKeyedMap
key
-
public boolean containsKey(Persistable p)
containsKey
in interface WTKeyedMap
p
-
public boolean containsKey(QueryKey query_key)
containsKey
in interface WTKeyedMap
query_key
-
public boolean containsKey(WTReference ref)
containsKey
in interface WTKeyedMap
ref
-
public boolean containsValue(Object value)
containsValue
in interface WTKeyedMap
value
-
public Set entrySet()
entrySet
in interface WTKeyedMap
public boolean equals(Object o)
equals
in interface WTKeyedMap
o
-
public Object get(Object key)
get
in interface WTKeyedMap
key
-
public Object get(Persistable p)
get
in interface WTKeyedMap
p
-
public Object get(QueryKey query_key)
get
in interface WTKeyedMap
query_key
-
public Object get(WTReference ref)
get
in interface WTKeyedMap
ref
-
public int getKeyMask()
getKeyMask
in interface WTKeyedMap
public int hashCode()
hashCode
in interface WTKeyedMap
public boolean isEmpty()
isEmpty
in interface WTKeyedMap
public boolean isEnabled(int mask)
isEnabled
in interface WTKeyedMap
mask
-
public Set keySet()
keySet
in interface WTKeyedMap
public Object put(Object key, Object value)
put
in interface WTKeyedMap
key
- value
-
public Object put(Persistable p, Object value)
put
in interface WTKeyedMap
p
- value
-
public Object put(QueryKey query_key, Object value)
put
in interface WTKeyedMap
query_key
- value
-
public Object put(WTReference ref, Object value)
put
in interface WTKeyedMap
ref
- value
-
public void putAll(Map map)
putAll
in interface WTKeyedMap
map
- public Object remove(Object key)
remove
in interface WTKeyedMap
key
-
public Object remove(Persistable p)
remove
in interface WTKeyedMap
p
-
public Object remove(QueryKey query_key)
remove
in interface WTKeyedMap
query_key
-
public Object remove(WTReference ref)
remove
in interface WTKeyedMap
ref
-
public int size()
size
in interface WTKeyedMap
public Collection values()
values
in interface WTKeyedMap
public WTSet wtKeySet()
wtKeySet
in interface WTKeyedMap
public void addElement(Object anObj)
addElement
in interface ResultProcessor
anObj
- Object connect(WTReference ref, Object value, boolean put_if_not_present)
ReferenceMap createReferenceMap()
Set createEntrySet()
WTSet createKeySet()
Collection createValues()
boolean containsNonPersistedKey(Persistable p)
Object removeNonPersistedKey(Persistable p)
WTKeyedMap.WTEntry createEntry(WTReference key)
WTKeyedMap.WTEntry getEntry(Persistable p)
WTKeyedMap.WTEntry getEntry(QueryKey query_key)
WTKeyedMap.WTEntry getEntry(WTReference ref)
WTKeyedMap.WTEntry referenceRemoved(WTReference r)
Object removeEntry(WTKeyedMap.WTEntry e)
Iterator entryIterator()
Iterator queryKeyIterator()
Iterator queryKeyIterator(Class filter, boolean include_subclasses)
Iterator persistableIterator() throws WTException
WTException
Iterator persistableIterator(Class filter, boolean include_subclasses) throws WTException
WTException
Iterator referenceKeyIterator()
Iterator referenceKeyIterator(Class filter, boolean include_subclasses)
WTSet expandableFilteredSet(Class filter, boolean include_subclasses, WTSet source)
public static int getInitialCapacity(int size)
size
- The number of mappings that will be added to the new map
protected void putClone(WTKeyedMap.WTEntry e, boolean deep)
e
- The entry to clone
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |