|
Oracle® Coherence Java API Reference Release 3.7.1.0 E22843-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.tangosol.util.WrapperCollections.ConcurrentWrapperEntry
public static class WrapperCollections.ConcurrentWrapperEntry
Map Entry implementation which uses a ReadWriteLock to manage concurrent access to an underlying Map Entry.
Field Summary | |
---|---|
protected java.util.concurrent.locks.ReadWriteLock |
m_lock The read/write lock for concurrency control. |
protected java.util.concurrent.locks.Lock |
m_lockExclusive The exclusive lock for performing read/write operations. |
protected java.util.concurrent.locks.Lock |
m_lockShared The shared lock for performing read operations. |
Constructor Summary | |
---|---|
|
WrapperCollections.ConcurrentWrapperEntry(java.util.Map.Entry entry) Create an ConcurrentWrapperEntry which delegates to the specified Map Entry. |
protected |
WrapperCollections.ConcurrentWrapperEntry(java.util.Map.Entry entry, java.util.concurrent.locks.ReadWriteLock lock) Create an ConcurrentWrapperEntry which delegates to the specified Map Entry. |
protected |
WrapperCollections.ConcurrentWrapperEntry(java.util.Map.Entry entry, java.util.concurrent.locks.ReadWriteLock lock, boolean fStrict) Create an ConcurrentWrapperEntry which delegates to the specified Map Entry. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o) Compares the specified object with this entry for equality. |
protected java.util.Map.Entry |
getDelegate() Return the Collection to which all operations should be delegated to. |
java.lang.Object |
getKey() Returns the key corresponding to this entry. |
protected java.util.concurrent.locks.ReadWriteLock |
getLock() Return the ReadWriteLock that is used to manage concurrent access and modifications to the underlying map. |
java.lang.Object |
getValue() Returns the value corresponding to this entry. |
int |
hashCode() Returns the hash code value for this map entry. |
java.lang.Object |
setValue(java.lang.Object value) Replaces the value corresponding to this entry with the specified value (optional operation). |
java.lang.String |
toString() |
Field Detail |
---|
protected final java.util.concurrent.locks.ReadWriteLock m_lock
protected final java.util.concurrent.locks.Lock m_lockShared
Note: This field is null if read-only operations are not supposed to be protected, i.e. if the "strict" option is not used.
protected final java.util.concurrent.locks.Lock m_lockExclusive
Constructor Detail |
---|
public WrapperCollections.ConcurrentWrapperEntry(java.util.Map.Entry entry)
entry
- the Map Entry to delegate all calls toprotected WrapperCollections.ConcurrentWrapperEntry(java.util.Map.Entry entry, java.util.concurrent.locks.ReadWriteLock lock)
entry
- the Map Entry to delegate all calls tolock
- a read/write lock for concurrency managementprotected WrapperCollections.ConcurrentWrapperEntry(java.util.Map.Entry entry, java.util.concurrent.locks.ReadWriteLock lock, boolean fStrict)
entry
- the Map Entry to delegate all calls tolock
- a read/write lock for concurrency managementfStrict
- pass true to protect all Entry methods; false to protect only the setValue() methodMethod Detail |
---|
public java.lang.Object getKey()
getKey
in interface java.util.Map.Entry
public java.lang.Object getValue()
getValue
in interface java.util.Map.Entry
public java.lang.Object setValue(java.lang.Object value)
setValue
in interface java.util.Map.Entry
value
- new value to be stored in this entry.public boolean equals(java.lang.Object o)
(e1.getKey()==null ? e2.getKey()==null : e1.getKey().equals(e2.getKey())) && (e1.getValue()==null ? e2.getValue()==null : e1.getValue().equals(e2.getValue()))This ensures that the equals method works properly across different implementations of the Map.Entry interface.
equals
in interface java.util.Map.Entry
o
- object to be compared for equality with this map entry.public int hashCode()
(e.getKey()==null ? 0 : e.getKey().hashCode()) ^ (e.getValue()==null ? 0 : e.getValue().hashCode())This ensures that e1.equals(e2) implies that e1.hashCode()==e2.hashCode() for any two Entries e1 and e2, as required by the general contract of Object.hashCode.
hashCode
in interface java.util.Map.Entry
Object.hashCode()
, Object.equals(Object)
, Map.Entry.equals(Object)
public java.lang.String toString()
protected java.util.Map.Entry getDelegate()
protected java.util.concurrent.locks.ReadWriteLock getLock()
|
Oracle® Coherence Java API Reference Release 3.7.1.0 E22843-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |