# Class: com.pnfsoftware.jeb.util.collect.ConcurrentList

A concurrent version of [ArrayList](ArrayList). Unlike [CopyOnWriteArrayList](CopyOnWriteArrayList), only iterator\-returning operations return defensive copies. Other write operations \(addition, insertion, deletion\) do not generate defensive copies. Also contains `safe` versions of add/set/get for convenience. Performing much better than [CopyOnWriteArrayList](CopyOnWriteArrayList) if write operations are frequent; get\(\) operations are slightly slower than [CopyOnWriteArrayList](CopyOnWriteArrayList)'s, so if they make up the majority of the invocations, [CopyOnWriteArrayList](CopyOnWriteArrayList) remains the best option.

## Constructor: ConcurrentList


## Constructor: ConcurrentList
- parameter: `initialCapacity`, type: `int`


## Constructor: ConcurrentList
- parameter: `list`, type: `java.util.ArrayList<T>`


## Method: add
- parameter: `index`, type: `int`
- parameter: `element`, type: `T`

Description: May raise [ArrayIndexOutOfBoundsException](ArrayIndexOutOfBoundsException) if index is greater than the list's size by the time the lock is acquired. Safe version: [#addSafe(int, Object)](#addSafe(int, Object)).

## Method: add
- parameter: `element`, type: `T`
- return type: `boolean`


## Method: addAll
- parameter: `c`, type: `java.util.Collection<? extends T>`
- return type: `boolean`


## Method: addAll
- parameter: `index`, type: `int`
- parameter: `c`, type: `java.util.Collection<? extends T>`
- return type: `boolean`

Description: May raise [ArrayIndexOutOfBoundsException](ArrayIndexOutOfBoundsException) if index is greater than the list's size by the time the lock is acquired.

## Method: addSafe
- parameter: `index`, type: `int`
- parameter: `element`, type: `T`
- return type: `boolean`


## Method: clear


## Method: contains
- parameter: `o`, type: `java.lang.Object`
- return type: `boolean`


## Method: containsAll
- parameter: `c`, type: `java.util.Collection<?>`
- return type: `boolean`


## Method: equals
- parameter: `obj`, type: `java.lang.Object`
- return type: `boolean`


## Method: get
- parameter: `index`, type: `int`
- return type: `T`

Description: May raise [ArrayIndexOutOfBoundsException](ArrayIndexOutOfBoundsException) if index is greater or equals than the list's size by the time the lock is acquired. Safe version: [#getSafe(int, Object)](#getSafe(int, Object)).

## Method: getSafe
- parameter: `index`, type: `int`
- parameter: `valueIfPastBound`, type: `T`
- return type: `T`


## Method: hashCode
- return type: `int`


## Method: indexOf
- parameter: `o`, type: `java.lang.Object`
- return type: `int`


## Method: isEmpty
- return type: `boolean`


## Method: iterator
- return type: `java.util.Iterator<T>`

Description: Returns an iterator that will iterate over a defensive copy. Modification operations will not impact the original list.

## Method: lastIndexOf
- parameter: `o`, type: `java.lang.Object`
- return type: `int`


## Method: listIterator
- return type: `java.util.ListIterator<T>`

Description: Returns a list iterator that will iterate over a defensive copy. Modification operations will not impact the original list.

## Method: listIterator
- parameter: `index`, type: `int`
- return type: `java.util.ListIterator<T>`

Description: Returns a list iterator that will iterate over a defensive copy. Modification operations will not impact the original list.

## Method: remove
- parameter: `o`, type: `java.lang.Object`
- return type: `boolean`


## Method: remove
- parameter: `index`, type: `int`
- return type: `T`

Description: May raise [ArrayIndexOutOfBoundsException](ArrayIndexOutOfBoundsException) if index is greater or equals than the list's size by the time the lock is acquired. Safe version: [#removeSafe(int)](#removeSafe(int)).

## Method: removeAll
- parameter: `c`, type: `java.util.Collection<?>`
- return type: `boolean`


## Method: removeSafe
- parameter: `index`, type: `int`
- return type: `boolean`


## Method: retainAll
- parameter: `c`, type: `java.util.Collection<?>`
- return type: `boolean`


## Method: set
- parameter: `index`, type: `int`
- parameter: `element`, type: `T`
- return type: `T`

Description: May raise [ArrayIndexOutOfBoundsException](ArrayIndexOutOfBoundsException) if index is greater or equals than the list's size by the time the lock is acquired. Safe version: [#setSafe(int, Object)](#setSafe(int, Object)).

## Method: setSafe
- parameter: `index`, type: `int`
- parameter: `element`, type: `T`
- return type: `boolean`


## Method: size
- return type: `int`


## Method: subList
- parameter: `fromIndex`, type: `int`
- parameter: `toIndex`, type: `int`
- return type: `java.util.List<T>`

Description: Returns a defensive copy. Modification operations will not impact the original list.

## Method: toArray
- return type: `java.lang.Object[]`


## Method: toArray
- parameter: `a`, type: `U[]`
- return type: `U[]`


## Method: toString
- return type: `java.lang.String`


