Package com.hazelcast.collection
Interface ICollection<E>
-
- Type Parameters:
E
- item
- All Superinterfaces:
java.util.Collection<E>
,DistributedObject
,java.lang.Iterable<E>
public interface ICollection<E> extends java.util.Collection<E>, DistributedObject
Concurrent, distributed, partitioned, listenable collection.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.UUID
addItemListener(ItemListener<E> listener, boolean includeValue)
Adds an item listener for this collection.java.lang.String
getName()
Returns the name of this collection.boolean
removeItemListener(java.util.UUID registrationId)
Removes the specified item listener.-
Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toArray
-
Methods inherited from interface com.hazelcast.core.DistributedObject
destroy, getDestroyContextForTenant, getPartitionKey, getServiceName
-
-
-
-
Method Detail
-
getName
@Nonnull java.lang.String getName()
Returns the name of this collection.- Specified by:
getName
in interfaceDistributedObject
- Returns:
- the unique name for this object.
-
addItemListener
@Nonnull java.util.UUID addItemListener(@Nonnull ItemListener<E> listener, boolean includeValue)
Adds an item listener for this collection. The listener will be notified of all collection add/remove events. Listeners are non-destructive: They are notified about changes in a collection, but they won't have any effect on the collection itself. This is particularly relevant for IQueue: A listener won't consume queue elements. It's not a replacement for Queue consumers.- Parameters:
listener
- the item listenerincludeValue
-true
if the updated item should be passed to the item listener,false
otherwise- Returns:
- returns the registration ID
-
removeItemListener
boolean removeItemListener(@Nonnull java.util.UUID registrationId)
Removes the specified item listener. Returns silently if the specified listener was not added before.- Parameters:
registrationId
- ID of the listener registration- Returns:
true
if the item listener is removed,false
otherwise
-
-