Class LXEngineThreadArrayList<T>

java.lang.Object
heronarts.lx.utils.LXEngineThreadArrayList<T>
Type Parameters:
T - Type of object stored by the list
All Implemented Interfaces:
Iterable<T>, Collection<T>, List<T>, RandomAccess, SequencedCollection<T>

public class LXEngineThreadArrayList<T> extends Object implements List<T>, RandomAccess
The LXEngineArrayList is a utility class that offers similar semantics to CopyOnWriteArrayList, but for the scenario in which it's understood that only the LXEngine thread ever writes to the list, while the UI thread may be frequently reading the list. A single persistent underlying ArrayList is used to represent the engine's copy of the list, and a copy is prepared for the UI thread on-demand. Transaction-like semantics are available for complex edit operations that may perform multiple changes before generating a new UI-thread copy.