Class CallbackList<E>

java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
com.topjohnwu.superuser.CallbackList<E>
All Implemented Interfaces:
Iterable<E>, Collection<E>, List<E>

public abstract class CallbackList<E> extends AbstractList<E>
An AbstractList that calls onAddElement when a new element is added to the list.

To simplify the API of Shell, both STDOUT and STDERR will output to Lists. This class is useful if you want to trigger a callback every time Shell outputs a new line.

The CallbackList itself does not have a data store. If you need one, you can provide a base List, and this class will delegate its calls to it.