Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.0.0

E18683-01


com.tangosol.util
Class SafeSortedMap.EntryNode

java.lang.Object
  extended by com.tangosol.util.SafeSortedMap.EntryNode

Direct Known Subclasses:
SafeSortedMap.BaseEntryNode
Enclosing class:
SafeSortedMap

protected static class SafeSortedMap.EntryNode
extends java.lang.Object

EntryNode represents a key-value mapping in this map.


Nested Class Summary
protected  class SafeSortedMap.EntryNode.MapEntry
          A Map.Entry view of the EntryNode.

 

Field Summary
protected static java.util.concurrent.atomic.AtomicReferenceFieldUpdater m_atomicUpdaterNext
          AtomicUpdater for the casNext operation.
protected static java.util.concurrent.atomic.AtomicReferenceFieldUpdater m_atomicUpdaterValue
          AtomicUpdater for the casValue operation.
protected  SafeSortedMap.EntryNode m_nodeNext
          The next SkipNode in the list.
protected  java.lang.Object m_oKey
          The key represented by this Node.
protected  java.lang.Object m_oValue
          The value represented by this EntryNode.

 

Constructor Summary
protected SafeSortedMap.EntryNode(java.lang.Object oKey, java.lang.Object oValue)
          Construct an EntryNode for the specified key and value.
protected SafeSortedMap.EntryNode(java.lang.Object oKey, java.lang.Object oValue, SafeSortedMap.EntryNode nodeNext)
          Construct an EntryNode for the specified key, value and next node.

 

Method Summary
protected  boolean casNext(java.lang.Object nodeAssume, java.lang.Object nodeNext)
          Atomically set the next EntryNode to the specified node iff the current next EntryNode matches the expected node.
protected  boolean casValue(java.lang.Object oValueAssume, java.lang.Object oValueNew)
          Atomically set the value of this EntryNode to the specified value iff the current value matches the assumed value.
 java.lang.Object getKey()
          Return the key that this node represents.
protected  SafeSortedMap.EntryNode.MapEntry getMapEntry()
          Return a MapEntry view of this EntryNode, suitable for returning to the EntrySet iterator.
protected  SafeSortedMap.EntryNode getNext()
          Return the next EntryNode in the entry list.
 java.lang.Object getValue()
          
protected  java.lang.Object getValueInternal()
          Return the value associated with the Map entry (could be NO_VALUE).
 void helpDelete(SafeSortedMap.EntryNode nodePrev, SafeSortedMap.EntryNode nodeNext)
          Called when a deleted EntryNode is encountered during a map traversal to help the deletion process complete.
 boolean isDeleted()
          Return true iff this EntryNode has been deleted.
 boolean markForDelete(SafeSortedMap.EntryNode nodeNext)
          Attempt to mark this EntryNode for deletion by appending a delete marker to follow this EntryNode, assuming that the expected nex EntryNode is the next.
protected  void setNext(SafeSortedMap.EntryNode nodeNext)
          Set the next EntryNode in the entry list.
 java.lang.String toString()
          Return a String representation of the SkipNode.

 

Field Detail

m_atomicUpdaterNext

protected static final java.util.concurrent.atomic.AtomicReferenceFieldUpdater m_atomicUpdaterNext
AtomicUpdater for the casNext operation.

m_atomicUpdaterValue

protected static final java.util.concurrent.atomic.AtomicReferenceFieldUpdater m_atomicUpdaterValue
AtomicUpdater for the casValue operation.

m_oKey

protected final java.lang.Object m_oKey
The key represented by this Node.

m_oValue

protected volatile java.lang.Object m_oValue
The value represented by this EntryNode. This is declared volatile so read operations can be unsynchronized.

m_nodeNext

protected volatile SafeSortedMap.EntryNode m_nodeNext
The next SkipNode in the list. This is declared volatile so read operations can be unsynchronized.

Constructor Detail

SafeSortedMap.EntryNode

protected SafeSortedMap.EntryNode(java.lang.Object oKey,
                                  java.lang.Object oValue)
Construct an EntryNode for the specified key and value.
Parameters:
oKey - the key that this EntryNode represents
oValue - the value that this EntryNode represents

SafeSortedMap.EntryNode

protected SafeSortedMap.EntryNode(java.lang.Object oKey,
                                  java.lang.Object oValue,
                                  SafeSortedMap.EntryNode nodeNext)
Construct an EntryNode for the specified key, value and next node.
Parameters:
oKey - the key that this EntryNode represents
oValue - the value that this EntryNode represents
nodeNext - the node to set as the "next" node

Method Detail

isDeleted

public boolean isDeleted()
Return true iff this EntryNode has been deleted.
Returns:
true iff this EntryNode has been deleted

markForDelete

public boolean markForDelete(SafeSortedMap.EntryNode nodeNext)
Attempt to mark this EntryNode for deletion by appending a delete marker to follow this EntryNode, assuming that the expected nex EntryNode is the next.
Parameters:
nodeNext - the expected "next" EntryNode
Returns:
true if a delete marker is successfully appended

helpDelete

public void helpDelete(SafeSortedMap.EntryNode nodePrev,
                       SafeSortedMap.EntryNode nodeNext)
Called when a deleted EntryNode is encountered during a map traversal to help the deletion process complete. This method attempts to finish appending delete markers and removing nodes from the linked list as appropriate.
Parameters:
nodePrev - the assumed predecessor to this EntryNode
nodeNext - the assumed successor to this EntryNode

getKey

public java.lang.Object getKey()
Return the key that this node represents.
Returns:
the key that this node represents

getValue

public java.lang.Object getValue()

casValue

protected boolean casValue(java.lang.Object oValueAssume,
                           java.lang.Object oValueNew)
Atomically set the value of this EntryNode to the specified value iff the current value matches the assumed value.
Parameters:
oValueAssume - the assumed value
oValueNew - the new value
Returns:
true iff the value is successfully updated

getMapEntry

protected SafeSortedMap.EntryNode.MapEntry getMapEntry()
Return a MapEntry view of this EntryNode, suitable for returning to the EntrySet iterator.
Returns:
a MapEntry view of this EntryNode

toString

public java.lang.String toString()
Return a String representation of the SkipNode.
Returns:
a human-readable String value describing this SkipNode

getValueInternal

protected java.lang.Object getValueInternal()
Return the value associated with the Map entry (could be NO_VALUE).
Returns:
the value associated with this Map entry

getNext

protected SafeSortedMap.EntryNode getNext()
Return the next EntryNode in the entry list.
Returns:
the next EntryNode in the entry list

setNext

protected void setNext(SafeSortedMap.EntryNode nodeNext)
Set the next EntryNode in the entry list.
Parameters:
nodeNext - the next EntryNode in the entry list

casNext

protected boolean casNext(java.lang.Object nodeAssume,
                          java.lang.Object nodeNext)
Atomically set the next EntryNode to the specified node iff the current next EntryNode matches the expected node.
Parameters:
nodeAssume - the assumed "next" EntryNode
nodeNext - the new "next" EntryNode
Returns:
true iff the next node is updated

Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.0.0

E18683-01


Copyright © 2000, 2011, Oracle and/or its affiliates. All rights reserved.