Interface ILcdCollection<T>
- All Superinterfaces:
Collection<T>
,Iterable<T>
- All Known Subinterfaces:
ILcdList<T>
- All Known Implementing Classes:
TLcdArrayList
,TLspGraphicsEffects
An extension of the Java Collection
which fires an TLcdCollectionEvent
for every element that is added to or removed
from the collection.
Due to those events, there is a decrease in performance compared to the traditional
Collection
when adding and/or removing multiple elements at once (e.g. addAll(java.util.Collection)
or removeAll(java.util.Collection)
). For every element
that is added or removed, those methods should fire an individual event. An example
implementation for such a method is:
public boolean addAll( Collection<? extends T> aCollection ) {
boolean result = false;
for ( T element : aCollection ) {
result = add( element ) || result;
}
return result;
}
- Since:
- 9.1
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addAll
(Collection<? extends T> aCollection) void
addCollectionListener
(ILcdCollectionListener<T> aCollectionListener) Register the listeneraCollectionListener
to be informed about changes in this collection.void
clear()
boolean
removeAll
(Collection<?> aCollection) void
removeCollectionListener
(ILcdCollectionListener<T> aCollectionListener) Unregister the listeneraCollectionListener
so it will no longer be informed about changes in this collection.boolean
retainAll
(Collection<?> aCollection) Methods inherited from interface java.util.Collection
add, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, remove, removeIf, size, spliterator, stream, toArray, toArray, toArray
-
Method Details
-
addAll
The elements should be added to the
Collection
one by one, and anTLcdCollectionEvent
fired each time an element has been added.- Specified by:
addAll
in interfaceCollection<T>
-
removeAll
The elements should be removed from the
Collection
one by one, and anTLcdCollectionEvent
fired each time an element has been removed.- Specified by:
removeAll
in interfaceCollection<T>
-
retainAll
The elements should be removed from the
Collection
one by one, and anTLcdCollectionEvent
fired each time an element has been removed.- Specified by:
retainAll
in interfaceCollection<T>
-
clear
void clear()The elements should be removed from the
Collection
one by one, and anTLcdCollectionEvent
fired each time an element has been removed.- Specified by:
clear
in interfaceCollection<T>
-
addCollectionListener
Register the listener
aCollectionListener
to be informed about changes in this collection.- Parameters:
aCollectionListener
- the listener- See Also:
-
removeCollectionListener
Unregister the listener
aCollectionListener
so it will no longer be informed about changes in this collection.This method should do nothing when
addCollectionListener
was not registered previously.- Parameters:
aCollectionListener
- the listener- See Also:
-