org.compass.core.util.concurrent
Class ConcurrentLinkedHashMap.Node<K,V>

java.lang.Object
  extended by org.compass.core.util.concurrent.ConcurrentLinkedHashMap.Node<K,V>
All Implemented Interfaces:
Serializable
Enclosing class:
ConcurrentLinkedHashMap<K,V>

static final class ConcurrentLinkedHashMap.Node<K,V>
extends Object
implements Serializable

A node on the double-linked list. This list cross-cuts the data store.


Nested Class Summary
static class ConcurrentLinkedHashMap.Node.State
           
 
Constructor Summary
ConcurrentLinkedHashMap.Node()
          Creates a sentinel node.
ConcurrentLinkedHashMap.Node(K key, V value)
          Creates a new, unlinked node.
 
Method Summary
 boolean casNext(ConcurrentLinkedHashMap.Node<K,V> expect, ConcurrentLinkedHashMap.Node<K,V> update)
           
 boolean casPrev(ConcurrentLinkedHashMap.Node<K,V> expect, ConcurrentLinkedHashMap.Node<K,V> update)
           
 boolean casState(ConcurrentLinkedHashMap.Node.State expect, ConcurrentLinkedHashMap.Node.State update)
           
 boolean casValue(V expect, V update)
           
 boolean equals(Object obj)
          Only ensures that the values are equal, as the key may be null for look-ups.
 V getAndSetValue(V value)
           
 K getKey()
           
 ConcurrentLinkedHashMap.Node<K,V> getNext()
           
 ConcurrentLinkedHashMap.Node<K,V> getPrev()
           
 ConcurrentLinkedHashMap.Node.State getState()
           
 V getValue()
           
 int hashCode()
          
 boolean isMarked()
           
 void setMarked(boolean marked)
           
 void setNext(ConcurrentLinkedHashMap.Node<K,V> node)
           
 void setPrev(ConcurrentLinkedHashMap.Node<K,V> node)
           
 void setState(ConcurrentLinkedHashMap.Node.State state)
           
 void setValue(V value)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConcurrentLinkedHashMap.Node

public ConcurrentLinkedHashMap.Node()
Creates a sentinel node.


ConcurrentLinkedHashMap.Node

public ConcurrentLinkedHashMap.Node(K key,
                                    V value)
Creates a new, unlinked node.

Method Detail

getKey

public K getKey()

getValue

public V getValue()

setValue

public void setValue(V value)

getAndSetValue

public V getAndSetValue(V value)

casValue

public boolean casValue(V expect,
                        V update)

getPrev

public ConcurrentLinkedHashMap.Node<K,V> getPrev()

setPrev

public void setPrev(ConcurrentLinkedHashMap.Node<K,V> node)

casPrev

public boolean casPrev(ConcurrentLinkedHashMap.Node<K,V> expect,
                       ConcurrentLinkedHashMap.Node<K,V> update)

getNext

public ConcurrentLinkedHashMap.Node<K,V> getNext()

setNext

public void setNext(ConcurrentLinkedHashMap.Node<K,V> node)

casNext

public boolean casNext(ConcurrentLinkedHashMap.Node<K,V> expect,
                       ConcurrentLinkedHashMap.Node<K,V> update)

isMarked

public boolean isMarked()

setMarked

public void setMarked(boolean marked)

getState

public ConcurrentLinkedHashMap.Node.State getState()

setState

public void setState(ConcurrentLinkedHashMap.Node.State state)

casState

public boolean casState(ConcurrentLinkedHashMap.Node.State expect,
                        ConcurrentLinkedHashMap.Node.State update)

equals

public boolean equals(Object obj)
Only ensures that the values are equal, as the key may be null for look-ups.

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright (c) 2004-2009 The Compass Project.