wt.fc.collections
Class WTValuedHashMap

java.lang.Object
  extended byjava.util.AbstractMap
      extended bywt.fc.collections.WTKeyedHashMap
          extended bywt.fc.collections.WTValuedHashMap
All Implemented Interfaces:
Cloneable, Externalizable, Map, ResultProcessor, Serializable, WTKeyedMap, WTValuedMap

public class WTValuedHashMap
extends WTKeyedHashMap
implements WTValuedMap, Externalizable

The key mask for the values collection can be specified in the constructor. If it is not specified, then the values use the same key mask as the keys.

Supported API: true

Extendable: false

See Also:
Serialized Form

Nested Class Summary
(package private)  class WTValuedHashMap.AllValues
           
(package private)  class WTValuedHashMap.DefaultWTValuedEntry
           
(package private)  class WTValuedHashMap.FilteredValues
           
 
Nested classes inherited from class wt.fc.collections.WTKeyedHashMap
WTKeyedHashMap.EntryIterator, WTKeyedHashMap.EntrySet, WTKeyedHashMap.ExpandableFilteredSet, WTKeyedHashMap.FilteredSet, WTKeyedHashMap.KeySet, WTKeyedHashMap.PersistableIterator, WTKeyedHashMap.QueryKeyIterator, WTKeyedHashMap.ReferenceIterator, WTKeyedHashMap.Values, WTKeyedHashMap.ValuesIterator, WTKeyedHashMap.WTKeyedEntry
 
Nested classes inherited from class java.util.AbstractMap
 
Nested classes inherited from class wt.fc.collections.WTValuedMap
WTValuedMap.WTValuedEntry
 
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
           
static long EXTERNALIZATION_VERSION_UID
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
(package private)  ReferenceMap valueMap
           
(package private)  int valueMask
           
 
Fields inherited from class wt.fc.collections.WTKeyedHashMap
DEFAULT_INITIAL_CAPACITY, DEFAULT_KEY_MASK, DEFAULT_LOAD_FACTOR, keyMap, keyMask, nonPersistedCount, referenceMap, wtEntrySet, wtKeySet, wtValues
 
Fields inherited from class java.util.AbstractMap
 
Fields inherited from interface wt.fc.collections.WTKeyedMap
DEFLATED_ON_SERIALIZATION
 
Constructor Summary
WTValuedHashMap()
          

Supported API: true
WTValuedHashMap(int initial_capacity)
          

Supported API: true
WTValuedHashMap(int initial_capacity, int key_mask)
          

Supported API: true
WTValuedHashMap(int initial_capacity, int key_mask, int value_mask)
          

Supported API: true
WTValuedHashMap(Map m)
          

Supported API: true
WTValuedHashMap(Map m, int key_mask)
          

Supported API: true
WTValuedHashMap(Map m, int key_mask, int value_mask)
          

Supported API: true
 
Method Summary
 void clear()
          

Supported API: false
 WTKeyedHashMap clone(boolean deep)
          

Supported API: true
(package private)  Object connect(WTReference ref, Object value, boolean put)
           
 boolean containsValue(Object value)
          

Supported API: false
(package private)  WTKeyedMap.WTEntry createEntry(WTReference r)
           
(package private)  Set createEntrySet()
           
(package private)  Collection createValues()
           
 Persistable getPersistable(Persistable key)
          Get the value that maps to the given key as a Persistable.
 Persistable getPersistable(QueryKey key)
          Get the value that maps to the given key as a Persistable.
 Persistable getPersistable(WTReference key)
          Get the value that maps to the given key as a Persistable.
 QueryKey getQueryKey(Persistable key)
          Get the value that maps to the given key as a QueryKey.
 QueryKey getQueryKey(QueryKey key)
          Get the value that maps to the given key as a QueryKey.
 QueryKey getQueryKey(WTReference key)
          Get the value that maps to the given key as a QueryKey.
 WTReference getReference(Persistable key)
          Get the value that maps to the given key as a WTReference.
 WTReference getReference(QueryKey key)
          Get the value that maps to the given key as a WTReference.
 WTReference getReference(WTReference key)
          Get the value that maps to the given key as a WTReference.
 int getValueMask()
          Get the key mask for the WTCollection of values in this map.
 void putAll(Map map)
          

Supported API: true
protected  void putClone(WTKeyedMap.WTEntry e, boolean deep)
          Put a clone of the mapping in the given entry into this map
 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(WTValuedHashMap thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
(package private)  WTKeyedMap.WTEntry referenceRemoved(WTReference r)
           
(package private)  Object removeEntry(WTKeyedMap.WTEntry e)
           
(package private)  WTValuedMap.WTValuedEntry valueReferenceRemoved(WTReference r)
           
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 WTCollection wtValues()
          Convenience method that returns the values in this map as a WTCollection.
 
Methods inherited from class wt.fc.collections.WTKeyedHashMap
addElement, clone, connect, connect, connect, connect, connect, connect, connect, connect, connect, connectAll, connectAll, containsKey, containsKey, containsKey, containsKey, containsNonPersistedKey, createKeySet, createReferenceMap, entryIterator, entrySet, equals, expandableFilteredSet, get, get, get, get, getEntry, getEntry, getEntry, getInitialCapacity, getKeyMask, hashCode, isDeflatedOnSerialization, isEmpty, isEnabled, keySet, persistableIterator, persistableIterator, put, put, put, put, queryKeyIterator, queryKeyIterator, readVersion, referenceKeyIterator, referenceKeyIterator, remove, remove, remove, remove, removeNonPersistedKey, setDeflatedOnSerialization, size, values, wtKeySet
 
Methods inherited from class java.util.AbstractMap
toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface wt.fc.collections.WTKeyedMap
connect, connect, connect, connect, connect, connect, connect, connect, connect, connectAll, connectAll, containsKey, containsKey, containsKey, containsKey, entrySet, equals, get, get, get, get, getKeyMask, hashCode, isDeflatedOnSerialization, isEmpty, isEnabled, keySet, put, put, put, put, remove, remove, remove, remove, setDeflatedOnSerialization, size, values, wtKeySet
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values

valueMask

int valueMask

valueMap

transient ReferenceMap valueMap
Constructor Detail

WTValuedHashMap

public WTValuedHashMap()


Supported API: true


WTValuedHashMap

public WTValuedHashMap(int initial_capacity)


Supported API: true

Parameters:
initial_capacity -

WTValuedHashMap

public WTValuedHashMap(int initial_capacity,
                       int key_mask)


Supported API: true

Parameters:
initial_capacity -
key_mask -

WTValuedHashMap

public WTValuedHashMap(int initial_capacity,
                       int key_mask,
                       int value_mask)


Supported API: true

Parameters:
initial_capacity -
key_mask -
value_mask -

WTValuedHashMap

public WTValuedHashMap(Map m)


Supported API: true

Parameters:
m -

WTValuedHashMap

public WTValuedHashMap(Map m,
                       int key_mask)


Supported API: true

Parameters:
m -
key_mask -

WTValuedHashMap

public WTValuedHashMap(Map m,
                       int key_mask,
                       int value_mask)


Supported API: true

Parameters:
m -
key_mask -
value_mask -
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Overrides:
writeExternal in class WTKeyedHashMap
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Overrides:
readExternal in class WTKeyedHashMap
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(WTValuedHashMap thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

clear

public void clear()


Supported API: false

Specified by:
clear in interface WTKeyedMap
Overrides:
clear in class WTKeyedHashMap

containsValue

public boolean containsValue(Object value)


Supported API: false

Specified by:
containsValue in interface WTKeyedMap
Overrides:
containsValue in class WTKeyedHashMap
Parameters:
value -
Returns:
boolean

getValueMask

public int getValueMask()
Get the key mask for the WTCollection of values in this map.

Supported API: false

Specified by:
getValueMask in interface WTValuedMap
Returns:
int

wtValues

public WTCollection wtValues()
Convenience method that returns the values in this map as a WTCollection. The resulting collection should be the same one that is returned by a call to values().

Supported API: false

Specified by:
wtValues in interface WTValuedMap
Returns:
WTCollection

getPersistable

public Persistable getPersistable(Persistable key)
                           throws WTException
Get the value that maps to the given key as a Persistable. If the value is not inflated, then the map will inflate it. This may result in the inflation of all instances of the uninflated object's class.

Supported API: false

Specified by:
getPersistable in interface WTValuedMap
Parameters:
key -
Returns:
The inflated Persistable value
Throws:
WTException

getPersistable

public Persistable getPersistable(QueryKey key)
                           throws WTException
Get the value that maps to the given key as a Persistable. If the value is not inflated, then the map will inflate it. This may result in the inflation of all instances of the uninflated object's class.

Supported API: false

Specified by:
getPersistable in interface WTValuedMap
Parameters:
key -
Returns:
The inflated Persistable value
Throws:
WTException

getPersistable

public Persistable getPersistable(WTReference key)
                           throws WTException
Get the value that maps to the given key as a Persistable. If the value is not inflated, then the map will inflate it. This may result in the inflation of all instances of the uninflated object's class.

Supported API: false

Specified by:
getPersistable in interface WTValuedMap
Parameters:
key -
Returns:
The inflated Persistable value
Throws:
WTException

getQueryKey

public QueryKey getQueryKey(Persistable key)
Get the value that maps to the given key as a QueryKey. If the value is non-persisted, then returns null.

Supported API: false

Specified by:
getQueryKey in interface WTValuedMap
Parameters:
key -
Returns:
null or the key

getQueryKey

public QueryKey getQueryKey(QueryKey key)
Get the value that maps to the given key as a QueryKey. If the value is non-persisted, then returns null.

Supported API: false

Specified by:
getQueryKey in interface WTValuedMap
Parameters:
key -
Returns:
null or the key

getQueryKey

public QueryKey getQueryKey(WTReference key)
Get the value that maps to the given key as a QueryKey. If the value is non-persisted, then returns null.

Supported API: false

Specified by:
getQueryKey in interface WTValuedMap
Parameters:
key -
Returns:
null or the key

getReference

public WTReference getReference(Persistable key)
Get the value that maps to the given key as a WTReference.

Supported API: false

Specified by:
getReference in interface WTValuedMap
Parameters:
key -
Returns:
WTReference

getReference

public WTReference getReference(QueryKey key)
Get the value that maps to the given key as a WTReference.

Supported API: false

Specified by:
getReference in interface WTValuedMap
Parameters:
key -
Returns:
WTReference

getReference

public WTReference getReference(WTReference key)
Get the value that maps to the given key as a WTReference.

Supported API: false

Specified by:
getReference in interface WTValuedMap
Parameters:
key -
Returns:
WTReference

clone

public WTKeyedHashMap clone(boolean deep)
Description copied from class: WTKeyedHashMap


Supported API: true

Overrides:
clone in class WTKeyedHashMap
Parameters:
deep -
Returns:
WTKeyedHashMap

putClone

protected void putClone(WTKeyedMap.WTEntry e,
                        boolean deep)
Description copied from class: WTKeyedHashMap
Put a clone of the mapping in the given entry into this map

Overrides:
putClone in class WTKeyedHashMap
Parameters:
e - The entry to clone

createEntrySet

Set createEntrySet()
Overrides:
createEntrySet in class WTKeyedHashMap

createValues

Collection createValues()
Overrides:
createValues in class WTKeyedHashMap

referenceRemoved

WTKeyedMap.WTEntry referenceRemoved(WTReference r)
Overrides:
referenceRemoved in class WTKeyedHashMap

connect

Object connect(WTReference ref,
               Object value,
               boolean put)
Overrides:
connect in class WTKeyedHashMap

createEntry

WTKeyedMap.WTEntry createEntry(WTReference r)
Overrides:
createEntry in class WTKeyedHashMap

removeEntry

Object removeEntry(WTKeyedMap.WTEntry e)
Overrides:
removeEntry in class WTKeyedHashMap

putAll

public void putAll(Map map)
Description copied from interface: WTKeyedMap


Supported API: true

Specified by:
putAll in interface WTKeyedMap
Overrides:
putAll in class WTKeyedHashMap
Parameters:
map -

valueReferenceRemoved

WTValuedMap.WTValuedEntry valueReferenceRemoved(WTReference r)