com.sun.jini.outrigger
Class FastList.Node

java.lang.Object
  extended by com.sun.jini.outrigger.FastList.Node
Direct Known Subclasses:
BaseHandle
Enclosing class:
FastList<T extends FastList.Node>

static class FastList.Node
extends Object

The type parameter for the FastList, T, must extend this type, and all nodes added to the list are of type T. A node can be added to a list at most once. Any attempt to add it again will result in an IllegalStateException.


Field Summary
private  long index
          This node does not need to be shown to scans with index greater than or equal to this index.
private  FastList<?> list
          null until the node is added to a list, then a reference to the list.
private  boolean removed
          True if this node has been removed from its list.
 
Constructor Summary
FastList.Node()
           
 
Method Summary
(package private)  void markOnList(FastList<?> list)
           
private  boolean remove()
          Remove this node from its list.
 boolean removed()
          Report whether the node has been removed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

removed

private volatile boolean removed
True if this node has been removed from its list. Protected by synchronization on the Node when an exact answer is needed, but often checked without synchronization to skip work of the Node is reported as removed. Transitions only from false to true.


index

private volatile long index
This node does not need to be shown to scans with index greater than or equal to this index.


list

private FastList<?> list
null until the node is added to a list, then a reference to the list. Once added to a list, it cannot be added to another. It can only be removed from the list to which it was added. Protected by synchronization on the node.

Constructor Detail

FastList.Node

FastList.Node()
Method Detail

remove

private boolean remove()
Remove this node from its list.

Returns:
true if this node has never previously been removed, false if it has already been removed.

markOnList

void markOnList(FastList<?> list)

removed

public boolean removed()
Report whether the node has been removed. If the result is true the node has definitely been removed. If it is false, the node may still have been removed. To get a fully reliable result, synchronize on the node.



Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.