org.eclipse.oomph.util

## Class ConcurrentArray<E>

- java.lang.Object
- - org.eclipse.oomph.util.ConcurrentArray<E>

- Direct Known Subclasses:
    ConcurrentArray.DuplicateCounter, ConcurrentArray.Unique

      public abstract class ConcurrentArray<E>
      extends Object

  Author:
    Eike Stepper

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ConcurrentArray.DuplicateCounter<E>`
    `static class` | `ConcurrentArray.Unique<E>`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected E[]` | `elements`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConcurrentArray()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(E element)`
    `void` | `clear()`
    `protected void` | `firstElementAdded()` Synchronized through `add(Object)`.
    `E[]` | `get()` Returns the elements, never `null`.
    `boolean` | `isEmpty()`
    `protected void` | `lastElementRemoved()` Synchronized through `remove(Object)`.
    `protected abstract E[]` | `newArray(int length)` Synchronized through `add(Object)` or `remove(Object)`.
    `boolean` | `remove(E element)`
    `protected boolean` | `validate(E element)` Synchronized through `add(Object)`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### elements

          protected E[] elements

  - ### Constructor Detail

    - #### ConcurrentArray

          public ConcurrentArray()

  - ### Method Detail

    - #### isEmpty

          public boolean isEmpty()

    - #### get

          public E[] get()

      Returns the elements, never `null`.

    - #### add

          public void add(E element)

    - #### remove

          public boolean remove(E element)

    - #### clear

          public void clear()

    - #### validate

          protected boolean validate(E element)

      Synchronized through `add(Object)`.

    - #### firstElementAdded

          protected void firstElementAdded()

      Synchronized through `add(Object)`.

    - #### lastElementRemoved

          protected void lastElementRemoved()

      Synchronized through `remove(Object)`.

    - #### newArray

          protected abstract E[] newArray(int length)

      Synchronized through `add(Object)` or `remove(Object)`.

Copyright (c) 2014 Eike Stepper (Berlin, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html