Interface SizedCollection

All Known Implementing Classes:
AbstractConcurrentSizedCollectionWrapper, ConcurrentCollectionWrapper, ConcurrentDequeWrapper, ConcurrentListWrapper, ConcurrentMapWrapper, ConcurrentQueueWrapper, ConcurrentSetFromMapWrapper, ConcurrentSetWrapper

public interface SizedCollection
A sized collection. This is a convenient interface applicable both to Collection and Map.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clears this collection.
    boolean
    Checks if this collection is empty.
    int
    Gets the size of this collection.
  • Method Details

    • size

      int size()
      Gets the size of this collection.
      Returns:
      size of this collection
    • isEmpty

      boolean isEmpty()
      Checks if this collection is empty.
      Returns:
      true if this collection is empty and false otherwise
    • clear

      @Contract(mutates="this") void clear()
      Clears this collection.
      Throws:
      UnsupportedOperationException - if clearing is not supported by this collection (e.g. it is unmodifiable)