com.hazelcast.core

## Interface ICollection<E>

- Type Parameters:
    `E` - item
  All Superinterfaces:
    Collection<E>, DistributedObject, Iterable<E>
  All Known Subinterfaces:
    IList<E>, IListJet<E>, IQueue<E>, ISet<E>
  All Known Implementing Classes:
    ClientListProxy, ClientQueueProxy, ClientSetProxy

      public interface ICollection<E>
      extends Collection<E>, DistributedObject

  Concurrent, distributed, partitioned, listenable collection.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `addItemListener(ItemListener<E> listener, boolean includeValue)` Adds an item listener for this collection.
    `String` | `getName()` Returns the name of this collection.
    `boolean` | `removeItemListener(String 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`

    - ### Methods inherited from interface java.lang.Iterable

      `forEach`

    - ### Methods inherited from interface com.hazelcast.core.DistributedObject

      `destroy, getPartitionKey, getServiceName`

- - ### Method Detail

    - #### getName

          String getName()

      Returns the name of this collection.
      Specified by:
        `getName` in interface `DistributedObject`
      Returns:
        the unique name for this object.

    - #### addItemListener

          String addItemListener(ItemListener<E> listener,
                                 boolean includeValue)

      Adds an item listener for this collection. The listener will be notified of all collection add/remove events.
      Parameters:
        `listener` - the item listener
        `includeValue` - `true` if the updated item should be passed to the item listener, `false` otherwise
      Returns:
        returns the registration ID

    - #### removeItemListener

          boolean removeItemListener(String 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

Copyright © 2019. All rights reserved.