Package gw.util.concurrent
Class Cache.ConcurrentLinkedHashMap.Node<K,V>
java.lang.Object
gw.util.concurrent.Cache.ConcurrentLinkedHashMap.Node<K,V>
- All Implemented Interfaces:
Serializable
- Enclosing class:
- Cache.ConcurrentLinkedHashMap<K,
V>
A node on the double-linked list. This list cross-cuts the data store.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Kprivate booleanprivate Cache.ConcurrentLinkedHashMap.Node<K,V> private static final AtomicReferenceFieldUpdater<Cache.ConcurrentLinkedHashMap.Node,Cache.ConcurrentLinkedHashMap.Node> private Cache.ConcurrentLinkedHashMap.Node<K,V> private static final AtomicReferenceFieldUpdater<Cache.ConcurrentLinkedHashMap.Node,Cache.ConcurrentLinkedHashMap.Node> private static final longprivate static final AtomicReferenceFieldUpdater<Cache.ConcurrentLinkedHashMap.Node,Cache.ConcurrentLinkedHashMap.Node.State> private Vprivate static final AtomicReferenceFieldUpdater<Cache.ConcurrentLinkedHashMap.Node,Object> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancasNext(Cache.ConcurrentLinkedHashMap.Node<K, V> expect, Cache.ConcurrentLinkedHashMap.Node<K, V> update) booleancasPrev(Cache.ConcurrentLinkedHashMap.Node<K, V> expect, Cache.ConcurrentLinkedHashMap.Node<K, V> update) booleancasState(Cache.ConcurrentLinkedHashMap.Node.State expect, Cache.ConcurrentLinkedHashMap.Node.State update) booleanbooleanOnly ensures that the values are equal, as the key may be null for look-ups.getAndSetValue(V value) getKey()getNext()getPrev()getState()getValue()inthashCode()booleanisMarked()voidsetMarked(boolean marked) voidvoidvoidvoidtoString()
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
valueUpdater
private static final AtomicReferenceFieldUpdater<Cache.ConcurrentLinkedHashMap.Node,Object> valueUpdater -
stateUpdater
private static final AtomicReferenceFieldUpdater<Cache.ConcurrentLinkedHashMap.Node,Cache.ConcurrentLinkedHashMap.Node.State> stateUpdater -
prevUpdater
private static final AtomicReferenceFieldUpdater<Cache.ConcurrentLinkedHashMap.Node,Cache.ConcurrentLinkedHashMap.Node> prevUpdater -
nextUpdater
private static final AtomicReferenceFieldUpdater<Cache.ConcurrentLinkedHashMap.Node,Cache.ConcurrentLinkedHashMap.Node> nextUpdater -
key
-
value
-
state
-
marked
private volatile boolean marked -
prev
-
next
-
-
Constructor Details
-
Node
public Node()Creates a sentinel node. -
Node
Creates a new, unlinked node.- Parameters:
key- the keyvalue- the value
-
-
Method Details
-
getKey
-
getValue
-
setValue
-
getAndSetValue
-
casValue
-
getPrev
-
setPrev
-
casPrev
public boolean casPrev(Cache.ConcurrentLinkedHashMap.Node<K, V> expect, Cache.ConcurrentLinkedHashMap.Node<K, V> update) -
getNext
-
setNext
-
casNext
public boolean casNext(Cache.ConcurrentLinkedHashMap.Node<K, V> expect, Cache.ConcurrentLinkedHashMap.Node<K, V> update) -
isMarked
public boolean isMarked() -
setMarked
public void setMarked(boolean marked) -
getState
-
setState
-
casState
public boolean casState(Cache.ConcurrentLinkedHashMap.Node.State expect, Cache.ConcurrentLinkedHashMap.Node.State update) -
equals
Only ensures that the values are equal, as the key may be null for look-ups. -
hashCode
public int hashCode() -
toString
-