Interface CollectionObservable<E,C extends Collection<E>>

Type Parameters:
E - Element type
C - Collection type
All Superinterfaces:
Observable<C>
All Known Subinterfaces:
ListObservable<E>, SetObservable<E>

@AvailableSince("0.0.39") public interface CollectionObservable<E,C extends Collection<E>> extends Observable<C>
Represents an observable containing multiple values
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    add(E element)
    Add an element to this observable
    boolean
    addAll(Collection<? extends E> collection)
    Add multiple elements to this observable
    void
    Clear all elements from this observable
    boolean
    remove(E element)
    Removes an element from this observable
    boolean
    removeAll(Collection<? extends E> collection)
    Remove multiple elements from this observable
    boolean
    removeIf(Predicate<? super E> filter)
    Remove all elements matching given predicate
    boolean
    retainAll(Collection<? extends E> collection)
    Remove all elements not in given collection
    Returns an observable representing the size of the observable.

    Methods inherited from interface net.apartium.cocoabeans.state.Observable

    get, map, observe, removeObserver, watch
  • Method Details

    • add

      boolean add(E element)
      Add an element to this observable
      Parameters:
      element - element to add
      Returns:
      true if successful, else false
      See Also:
    • remove

      boolean remove(E element)
      Removes an element from this observable
      Parameters:
      element - element to remove
      Returns:
      true if successful, else false
      See Also:
    • addAll

      boolean addAll(Collection<? extends E> collection)
      Add multiple elements to this observable
      Parameters:
      collection - elements to add
      Returns:
      true if successful, else false
      See Also:
    • removeAll

      boolean removeAll(Collection<? extends E> collection)
      Remove multiple elements from this observable
      Parameters:
      collection - elements to remove
      Returns:
      true if successful, else false
      See Also:
    • removeIf

      boolean removeIf(Predicate<? super E> filter)
      Remove all elements matching given predicate
      Parameters:
      filter - predicate
      Returns:
      true if successful, else false
      See Also:
    • retainAll

      boolean retainAll(Collection<? extends E> collection)
      Remove all elements not in given collection
      Parameters:
      collection - collection
      Returns:
      true if successful, else false
      See Also:
    • clear

      void clear()
      Clear all elements from this observable
      See Also:
    • size

      Returns an observable representing the size of the observable. When the size of the current observable changes, the size observable will emit the new size.
      Returns:
      size observable