## org.h2.dev.util
Class ConcurrentLinkedList<K>

    java.lang.Object
      org.h2.dev.util.ConcurrentLinkedList<K>

Type Parameters:
  `K` - the key type

    public class ConcurrentLinkedList<K>

extends java.lang.Object

A very simple linked list that supports concurrent access. Internally, it uses immutable objects. It uses recursion and is not meant for long lists.

Constructor Summary
`ConcurrentLinkedList()`

Method Summary
`void` `add(K obj)` Add an element at the end.
`java.util.Iterator<K>` `iterator()` Get an iterator over all entries.
`K` `peekFirst()` Get the first element, or null if none.
`K` `peekLast()` Get the last element, or null if none.
`boolean` `removeFirst(K obj)` Remove the first element, if it matches.
`boolean` `removeLast(K obj)` Remove the last element, if it matches.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ConcurrentLinkedList

    public ConcurrentLinkedList()

Method Detail

### peekFirst

    public K peekFirst()

  Get the first element, or null if none.

  Returns:
    the first element

### peekLast

    public K peekLast()

  Get the last element, or null if none.

  Returns:
    the last element

### add

    public void add(K obj)

  Add an element at the end.

  Parameters:
    `obj` - the element

### removeFirst

    public boolean removeFirst(K obj)

  Remove the first element, if it matches.

  Parameters:
    `obj` - the element to remove
  Returns:
    true if the element matched and was removed

### removeLast

    public boolean removeLast(K obj)

  Remove the last element, if it matches.

  Parameters:
    `obj` - the element to remove
  Returns:
    true if the element matched and was removed

### iterator

    public java.util.Iterator<K> iterator()

  Get an iterator over all entries.

  Returns:
    the iterator