Interface MutableCollection<T>

All Superinterfaces:
Iterable<T>, Traversable<T>
All Known Implementing Classes:
MutableList, MutableSet

public interface MutableCollection<T> extends Traversable<T>
Common methods of MutableList and MutableSet.
  • Method Details

    • add

      boolean add(T element)
      Adds element to this collection.
      Returns:
      true if the collection has changed, false otherwise
    • addAll

      default boolean addAll(Collection<? extends T> elements)
      Adds elements to this collection.
      Returns:
      true if the collection has changed, false otherwise
    • clear

      default void clear()
      Removes all elements from the collection.
    • removeAllMatching

      default boolean removeAllMatching(Predicate<? super T> condition)
      Removes all elements matching given condition from the collection. Returns true if the collection was modified.
    • retainAllMatching

      default boolean retainAllMatching(Predicate<? super T> condition)
      Retains only elements matching given condition in the collection. Returns true if the collection was modified.
    • remove

      default boolean remove(T item)
      Removes one occurence of given item from the collection. Returns true if the collection was modified.