org.eclipse.net4j.util.collection
Class ConcurrentArray<E>

java.lang.Object
  extended by org.eclipse.net4j.util.collection.ConcurrentArray<E>
Direct Known Subclasses:
ConcurrentArray.DuplicateCounter, ConcurrentArray.Unique, FastList

public abstract class ConcurrentArray<E>
extends Object

Since:
3.2

Nested Class Summary
static class ConcurrentArray.DuplicateCounter<E>
           
static class ConcurrentArray.Unique<E>
           
 
Field Summary
protected  E[] elements
           
 
Constructor Summary
ConcurrentArray()
           
 
Method Summary
 void add(E element)
           
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)

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) 2011, 2012 Eike Stepper (Berlin, Germany) and others.