org.h2.mvstore

## Class ConcurrentArrayList<K>

- java.lang.Object
- - org.h2.mvstore.ConcurrentArrayList<K>

Type Parameters:
  `K` - the key type

    public class ConcurrentArrayList<K>
    extends java.lang.Object

A very simple array list that supports concurrent access. Internally, it uses immutable objects.

### Constructor Summary

Constructors
Constructor and Description
`ConcurrentArrayList()`

### Method Summary

Methods
`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

#### ConcurrentArrayList

    public ConcurrentArrayList()

### 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