org.elasticsearch.common.util.concurrent
Class ConcurrentSafeArray<T>

java.lang.Object
  extended by org.elasticsearch.common.util.concurrent.ConcurrentSafeArray<T>
All Implemented Interfaces:
SafeArray<T>

@ThreadSafe
public class ConcurrentSafeArray<T>
extends java.lang.Object
implements SafeArray<T>

A concurrent version of SafeArray.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.elasticsearch.common.collect.SafeArray
SafeArray.Procedure<T>
 
Constructor Summary
ConcurrentSafeArray()
           
 
Method Summary
 void add(int index, T value)
           
 void add(T value)
           
 void clear()
           
 boolean forEach(SafeArray.Procedure<T> procedure)
          Applies the procedure to each value in the list in ascending (front to back) order.
 T get(int index)
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConcurrentSafeArray

public ConcurrentSafeArray()
Method Detail

get

public T get(int index)
Specified by:
get in interface SafeArray<T>

size

public int size()
Specified by:
size in interface SafeArray<T>

add

public void add(T value)
Specified by:
add in interface SafeArray<T>

add

public void add(int index,
                T value)
Specified by:
add in interface SafeArray<T>

clear

public void clear()
Specified by:
clear in interface SafeArray<T>

forEach

public boolean forEach(SafeArray.Procedure<T> procedure)
Description copied from interface: SafeArray
Applies the procedure to each value in the list in ascending (front to back) order.

Specified by:
forEach in interface SafeArray<T>
Parameters:
procedure - a Procedure value
Returns:
true if the procedure did not terminate prematurely.