-
- All Implemented Interfaces:
-
java.lang.Iterable,java.util.Collection,java.util.List,java.util.SequencedCollection
public abstract class BaseObservableSnapshotArray<S, E, L extends BaseChangeEventListener<S, E>, T> extends AbstractList<T>
-
-
Constructor Summary
Constructors Constructor Description BaseObservableSnapshotArray(BaseCachingSnapshotParser<S, T> parser)Create an BaseObservableSnapshotArray with a custom BaseSnapshotParser.
-
Method Summary
Modifier and Type Method Description Tget(int index)intsize()SgetSnapshot(int index)Returns the snapshot at the specified position in this list. LaddChangeEventListener(@NonNull() L listener)Attach a BaseChangeEventListener to this array. voidremoveChangeEventListener(@NonNull() L listener)Remove a listener from the array. voidremoveAllListeners()Remove all listeners from the array and reset its state. booleanisListening()booleanisListening(@NonNull() L listener)voidclear()Clear data and notify all listeners. -
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, get, hashCode, indexOf, iterator, lastIndexOf, listIterator, remove, set, subList -
Methods inherited from class java.util.AbstractCollection
contains, containsAll, isEmpty, remove, removeAll, retainAll, size, toArray, toArray, toString -
Methods inherited from class java.util.Collection
parallelStream, removeIf, spliterator, stream -
Methods inherited from class java.lang.Iterable
forEach, iterator, spliterator -
Methods inherited from class java.util.List
addFirst, addLast, copyOf, getFirst, getLast, of, removeFirst, removeLast, replaceAll, reversed, sort -
Methods inherited from class java.util.SequencedCollection
reversed -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
BaseObservableSnapshotArray
BaseObservableSnapshotArray(BaseCachingSnapshotParser<S, T> parser)
Create an BaseObservableSnapshotArray with a custom BaseSnapshotParser.- Parameters:
parser- the BaseSnapshotParser to use
-
-
Method Detail
-
size
int size()
-
getSnapshot
@NonNull() S getSnapshot(int index)
Returns the snapshot at the specified position in this list.
- Parameters:
index- index of the snapshot to return
-
addChangeEventListener
@CallSuper()@NonNull() L addChangeEventListener(@NonNull() L listener)
Attach a BaseChangeEventListener to this array. The listener will receive one event for each item that already exists in the array at the time ofattachment, a onDataChanged event if one has occurred, andthen receive all future child events.
If this is the first listener, onCreate will be called.
-
removeChangeEventListener
@CallSuper() void removeChangeEventListener(@NonNull() L listener)
Remove a listener from the array.
If no listeners remain, onDestroy will be called.
-
removeAllListeners
@CallSuper() void removeAllListeners()
Remove all listeners from the array and reset its state.
-
isListening
boolean isListening()
-
isListening
boolean isListening(@NonNull() L listener)
-
clear
void clear()
Clear data and notify all listeners.
-
-
-
-