CALLBACKTYPE - The callback type.@ThreadSafe public class CallbackList<CALLBACKTYPE extends ICallback> extends Object implements ICallbackList<CALLBACKTYPE>, ICloneable<CallbackList<CALLBACKTYPE>>
| Constructor and Description |
|---|
CallbackList() |
CallbackList(CallbackList<CALLBACKTYPE> aOther) |
| Modifier and Type | Method and Description |
|---|---|
EChange |
add(CALLBACKTYPE aCallback)
Add a callback.
|
EChange |
addAll(CALLBACKTYPE... aCallbacks) |
void |
forEach(Consumer<? super CALLBACKTYPE> aConsumer) |
EContinue |
forEachBreakable(Function<? super CALLBACKTYPE,EContinue> aFunction)
A special version of
Iterable.forEach(Consumer) that can break iteration if
a certain requirement is fulfilled. |
ICommonsList<CALLBACKTYPE> |
getAllCallbacks() |
CALLBACKTYPE |
getCallbackAtIndex(int nIndex)
Get the callback at the specified index.
|
CallbackList<CALLBACKTYPE> |
getClone() |
boolean |
isEmpty() |
Iterator<CALLBACKTYPE> |
iterator() |
EChange |
removeAll()
Remove all callbacks
|
EChange |
removeObject(CALLBACKTYPE aCallback)
Remove the specified callback
|
EChange |
set(CallbackList<CALLBACKTYPE> rhs) |
EChange |
set(CALLBACKTYPE aCallback) |
int |
size() |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcontainsAny, containsNone, containsOnly, findAll, findAllInstanceOf, findAllMapped, findAllMapped, findAllMapped, findFirst, findFirst, findFirstMapped, findFirstMapped, forEach, forEachByIndex, getCount, getCountspliteratorisNotEmptypublic CallbackList()
public CallbackList(@Nullable CallbackList<CALLBACKTYPE> aOther)
@Nonnull public EChange set(@Nonnull CallbackList<CALLBACKTYPE> rhs)
@Nonnull public EChange set(@Nonnull CALLBACKTYPE aCallback)
@Nonnull public EChange add(@Nonnull CALLBACKTYPE aCallback)
aCallback - May not be null.EChange@Nonnull @SafeVarargs public final EChange addAll(@Nonnull CALLBACKTYPE... aCallbacks)
@Nonnull public EChange removeObject(@Nullable CALLBACKTYPE aCallback)
aCallback - May be null.EChange@Nonnull @ReturnsMutableCopy public ICommonsList<CALLBACKTYPE> getAllCallbacks()
getAllCallbacks in interface ICallbackList<CALLBACKTYPE extends ICallback>null and only
containing non-null elements.@Nullable public CALLBACKTYPE getCallbackAtIndex(@Nonnegative int nIndex)
ICallbackListgetCallbackAtIndex in interface ICallbackList<CALLBACKTYPE extends ICallback>nIndex - The index to be retrieved. Should be ≥ 0.null if the provided index is invalid.@Nonnegative public int size()
public boolean isEmpty()
isEmpty in interface IHasSizetrue if no items are present, false if at
least a single item is present.IHasSize.size(),
IHasSize.isNotEmpty()@Nonnull public CallbackList<CALLBACKTYPE> getClone()
getClone in interface ICloneable<CallbackList<CALLBACKTYPE extends ICallback>>@Nonnull public Iterator<CALLBACKTYPE> iterator()
iterator in interface Iterable<CALLBACKTYPE extends ICallback>public void forEach(@Nonnull Consumer<? super CALLBACKTYPE> aConsumer)
forEach in interface Iterable<CALLBACKTYPE extends ICallback>@Nonnull public EContinue forEachBreakable(@Nonnull Function<? super CALLBACKTYPE,EContinue> aFunction)
ICommonsIterableIterable.forEach(Consumer) that can break iteration if
a certain requirement is fulfilled.forEachBreakable in interface ICommonsIterable<CALLBACKTYPE extends ICallback>aFunction - The consumer to be invoked. May not be null.EContinue.BREAK if iteration was stopped,
EContinue.CONTINUE otherwise.Copyright © 2014–2017 Philip Helger. All rights reserved.