|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.util.AbstractMap
java.util.HashMap
org.apache.jdo.impl.sco.HashMap
A mutable 2nd class object that represents HashMap.
HashMap,
Serialized Form| Nested Class Summary |
| Nested classes inherited from class java.util.HashMap |
|
| Nested classes inherited from class java.util.AbstractMap |
|
| Nested classes inherited from class java.util.Map |
java.util.Map.Entry |
| Field Summary | |
private static java.lang.String |
_HashMap
|
private java.util.ArrayList |
addedKeys
|
private java.util.ArrayList |
addedValues
|
private boolean |
allowNulls
|
private int |
fieldNumber
|
private java.util.Map.Entry[] |
frozenEntries
|
private java.lang.Class |
keyType
|
private static org.apache.jdo.util.I18NHelper |
msg
I18N message handler |
private StateManagerInternal |
owner
|
private java.util.ArrayList |
removedKeys
|
private java.util.ArrayList |
removedValues
|
private java.lang.Class |
valueType
|
| Fields inherited from class java.util.HashMap |
|
| Fields inherited from class java.util.AbstractMap |
|
| Constructor Summary | |
HashMap(java.lang.Class keyType,
java.lang.Class valueType,
boolean allowNulls)
Creates a new empty HashMap object. |
|
HashMap(java.lang.Class keyType,
java.lang.Class valueType,
boolean allowNulls,
int initialCapacity)
Creates a new empty HashMap object that has
the specified initial capacity. |
|
HashMap(java.lang.Class keyType,
java.lang.Class valueType,
boolean allowNulls,
int initialCapacity,
float loadFactor)
Creates a new empty HashMap object that has
the specified initial capacity.. |
|
| Method Summary | |
boolean |
allowNulls()
Returns whether nulls are permitted as keys or values. |
void |
clear()
Removes all of the elements from this map. |
void |
clearInternal()
Clears Map without recording the event. |
java.lang.Object |
clone()
Creates and returns a copy of this object. |
boolean |
containsKey(java.lang.Object key)
These methods need to thaw the map before performing the operation. |
boolean |
containsValue(java.lang.Object value)
|
java.util.Iterator |
eitherIterator()
Get an iterator regardless of whether the map is frozen. |
java.util.Set |
entrySet()
|
boolean |
equals(java.lang.Object o)
|
java.util.Iterator |
frozenIterator()
Get an iterator over the frozen elements of this map. |
java.lang.Object |
get(java.lang.Object key)
|
java.util.Collection |
getAddedKeys()
Returns the Collection of added keys |
java.util.Collection |
getAddedValues()
Returns the Collection of added values |
java.lang.String |
getFieldName()
Returns the field name |
private java.util.Map.Entry[] |
getFrozen()
Returns the frozen contents of this Map as a Map.Entry[]. |
java.lang.Class |
getKeyType()
Returns the type of the key assignment compatible with all keys of this map. |
java.lang.Object |
getOwner()
Returns the owner object of the SCO instance |
java.util.Collection |
getRemovedKeys()
Returns the Collection of removed keys |
java.util.Collection |
getRemovedValues()
Returns the Collection of removed values |
java.lang.Class |
getValueType()
Returns the type of the value assignment compatible with all values of this map. |
int |
hashCode()
|
boolean |
isEmpty()
|
private boolean |
isFrozen()
Returns the frozen state of this Map. |
java.util.Set |
keySet()
|
private void |
makeDirty()
Notify StateManager to mark field as dirty. |
private java.lang.Object |
process(java.lang.Object key,
java.lang.Object value)
Processes single put operation in this map. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Associates the specified value with the specified key in this map. |
void |
putAll(java.util.Map t)
Copies all of the mappings from the specified map to this one. |
void |
putAllInternal(java.util.Map t)
Copies all of the mappings from the specified map to this one without recording the event. |
void |
putInternal(java.lang.Object key,
java.lang.Object value)
Associates the specified value with the specified key in this map without recording the event. |
java.lang.Object |
remove(java.lang.Object key)
Removes the mapping for this key from this map if present. |
void |
removeInternal(java.lang.Object key)
Removes mappings from the Map without recording the event. |
void |
reset()
Resets removed and added lists after flush |
void |
setFrozen(java.util.Map.Entry[] entries)
Set the contents of this Map from the frozen entries. |
void |
setOwner(java.lang.Object owner,
int fieldNumber)
Sets the owner and field number. |
int |
size()
|
private void |
thaw()
Thaw the frozen elements of this map. |
java.lang.String |
toString()
|
private void |
trackUpdates(boolean modified)
Notify StateManager to process the changes. |
void |
unsetOwner(java.lang.Object owner,
int fieldNumber)
Nullifies references to the owner Object iff the passed in owner and fieldNumber match. |
java.util.Collection |
values()
|
| Methods inherited from class java.util.HashMap |
|
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
private transient StateManagerInternal owner
private transient int fieldNumber
private transient java.lang.Class keyType
private transient java.lang.Class valueType
private transient boolean allowNulls
private transient java.util.ArrayList addedKeys
private transient java.util.ArrayList addedValues
private transient java.util.ArrayList removedKeys
private transient java.util.ArrayList removedValues
private transient java.util.Map.Entry[] frozenEntries
private static final org.apache.jdo.util.I18NHelper msg
private static final java.lang.String _HashMap
| Constructor Detail |
public HashMap(java.lang.Class keyType,
java.lang.Class valueType,
boolean allowNulls)
HashMap object.
keyType - the type of the keys allowed.valueType - the type of the values allowed.allowNulls - true if nulls are allowed.HashMap
public HashMap(java.lang.Class keyType,
java.lang.Class valueType,
boolean allowNulls,
int initialCapacity)
HashMap object that has
the specified initial capacity.
keyType - the type of the keys allowed.valueType - the type of the values allowed.allowNulls - true if nulls are allowedinitialCapacity - the initial capacity of the hash map.
java.lang.IllegalArgumentException - if the initial capacity is less
than zero.HashMap
public HashMap(java.lang.Class keyType,
java.lang.Class valueType,
boolean allowNulls,
int initialCapacity,
float loadFactor)
HashMap object that has
the specified initial capacity..
keyType - the type of the keys allowed.valueType - the type of the values allowed.allowNulls - true if nulls are allowedinitialCapacity - the initial capacity of the hash map.loadFactor - the load factor of the hash map.
java.lang.IllegalArgumentException - if the initial capacity is less
than zero.HashMap| Method Detail |
public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
put in interface java.util.Mapkey - key with which the specified value is to be associated.value - value to be associated with the specified key.
HashMappublic void putAll(java.util.Map t)
putAll in interface java.util.Mapt - Mappings to be stored in this map.HashMappublic java.lang.Object remove(java.lang.Object key)
remove in interface java.util.Mapkey - key whose mapping is to be removed from the map.
HashMappublic void clear()
clear in interface java.util.MapHashMappublic java.lang.Object clone()
Mutable Second Class Objects are required to provide a public clone method in order to allow for copying PersistenceCapable objects. In contrast to Object.clone(), this method must not throw a CloneNotSupportedException.
clone in interface SCOpublic boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Mappublic boolean containsValue(java.lang.Object value)
containsValue in interface java.util.Mappublic java.util.Set entrySet()
entrySet in interface java.util.Mappublic boolean equals(java.lang.Object o)
equals in interface java.util.Mappublic java.lang.Object get(java.lang.Object key)
get in interface java.util.Mappublic int hashCode()
hashCode in interface java.util.Mappublic boolean isEmpty()
isEmpty in interface java.util.Mappublic java.util.Set keySet()
keySet in interface java.util.Mappublic int size()
size in interface java.util.Mappublic java.util.Collection values()
values in interface java.util.Mappublic java.lang.String toString()
public void reset()
SCOMap
reset in interface SCOMapSCOMap.reset()
public void putInternal(java.lang.Object key,
java.lang.Object value)
SCOMap
putInternal in interface SCOMapSCOMap.putInternal(Object key, Object value)public void putAllInternal(java.util.Map t)
SCOMap
putAllInternal in interface SCOMapSCOMap.putAllInternal(Map t)public java.util.Collection getAddedKeys()
SCOMap
getAddedKeys in interface SCOMapSCOMap.getAddedKeys()public java.util.Collection getAddedValues()
SCOMap
getAddedValues in interface SCOMapSCOMap.getAddedValues()public java.util.Collection getRemovedKeys()
SCOMap
getRemovedKeys in interface SCOMapSCOMap.getRemovedKeys()public java.util.Collection getRemovedValues()
SCOMap
getRemovedValues in interface SCOMapSCOMap.getRemovedValues()public void clearInternal()
SCOMap
clearInternal in interface SCOMapSCOMap.clearInternal()public void removeInternal(java.lang.Object key)
SCOMap
removeInternal in interface SCOMapSCOMap.removeInternal(Object key)
public void unsetOwner(java.lang.Object owner,
int fieldNumber)
SCO
unsetOwner in interface SCOowner - the existing owner object.fieldNumber - the existing number of the field.SCO.unsetOwner(Object owner, int fieldNumber)
public void setOwner(java.lang.Object owner,
int fieldNumber)
SCO
setOwner in interface SCOowner - the owner object.fieldNumber - the number of the field associated with this instance.(Object owner, int fieldNumber)public java.lang.Object getOwner()
SCO
getOwner in interface SCOSCO.getOwner()public java.lang.String getFieldName()
SCO
getFieldName in interface SCOSCO.getFieldName()private void makeDirty()
private void trackUpdates(boolean modified)
public java.lang.Class getKeyType()
SCOMap
getKeyType in interface SCOMap{public java.lang.Class getValueType()
SCOMap
getValueType in interface SCOMap{public boolean allowNulls()
SCOMap
allowNulls in interface SCOMap{
private java.lang.Object process(java.lang.Object key,
java.lang.Object value)
key - key with which the specified value is to be associated.value - value to be associated with the specified key.
private boolean isFrozen()
private java.util.Map.Entry[] getFrozen()
public void setFrozen(java.util.Map.Entry[] entries)
setFrozen in interface SCOMapentries - the frozen entriespublic java.util.Iterator eitherIterator()
eitherIterator in interface SCOMappublic java.util.Iterator frozenIterator()
frozenIterator in interface SCOMapprivate void thaw()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||