Skip navigation links

Oracle® Coherence Java API Reference
Release 3.6.0.0

E15725-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 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 AtomicReferenceFieldUpdater m_atomicUpdaterNext
          AtomicUpdater for the casNext operation.
protected static AtomicReferenceFieldUpdater m_atomicUpdaterValue
          AtomicUpdater for the casValue operation.
protected  SafeSortedMap.EntryNode m_nodeNext
          The next SkipNode in the list.
protected  Object m_oKey
          The key represented by this Node.
protected  Object m_oValue
          The value represented by this EntryNode.

 

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

 

Method Summary
protected  boolean casNext(Object nodeAssume, Object nodeNext)
          Atomically set the next EntryNode to the specified node iff the current next EntryNode matches the expected node.
protected  boolean casValue(Object oValueAssume, Object oValueNew)
          Atomically set the value of this EntryNode to the specified value iff the current value matches the assumed value.
 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.
 Object getValue()
          
protected  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.
 String toString()
          Return a String representation of the SkipNode.

 

Field Detail

m_atomicUpdaterNext

protected static final AtomicReferenceFieldUpdater m_atomicUpdaterNext
AtomicUpdater for the casNext operation.

m_atomicUpdaterValue

protected static final AtomicReferenceFieldUpdater m_atomicUpdaterValue
AtomicUpdater for the casValue operation.

m_oKey

protected final Object m_oKey
The key represented by this Node.

m_oValue

protected volatile 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(Object oKey,
                                  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(Object oKey,
                                  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 Object getKey()
Return the key that this node represents.
Returns:
the key that this node represents

getValue

public Object getValue()

casValue

protected boolean casValue(Object oValueAssume,
                           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 String toString()
Return a String representation of the SkipNode.
Returns:
a human-readable String value describing this SkipNode

getValueInternal

protected 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(Object nodeAssume,
                          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.6.0.0

E15725-01


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