Interface UnmodifiableEconomicSet<E>

All Superinterfaces:
Iterable<E>
All Known Subinterfaces:
EconomicSet<E>

public interface UnmodifiableEconomicSet<E> extends Iterable<E>
Unmodifiable memory efficient set data structure. It does not support looking up a null element.
Since:
19.0
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    contains(E element)
    Returns true if this set contains a mapping for the element.
    default boolean
    containsAll(Iterable<? extends E> coll)
     
    boolean
    Returns true if this set contains no elements.
    default boolean
    removeIf(Predicate<? super E> filter)
     
    int
    Returns the number of elements in this set.
    default E[]
    toArray(E[] target)
    Stores all the elements in this set into target.
    default HashSet<E>
     
    default List<E>
     

    Methods inherited from interface Iterable

    forEach, iterator, spliterator
  • Method Details

    • contains

      boolean contains(E element)
      Returns true if this set contains a mapping for the element.
      Throws:
      UnsupportedOperationException - if element == null
      Since:
      19.0
    • size

      int size()
      Returns the number of elements in this set.
      Since:
      19.0
    • isEmpty

      boolean isEmpty()
      Returns true if this set contains no elements.
      Since:
      19.0
    • toArray

      default E[] toArray(E[] target)
      Stores all the elements in this set into target. An UnsupportedOperationException will be thrown if the length of target does not match the size of this set.
      Returns:
      an array containing all the elements in this set.
      Throws:
      UnsupportedOperationException - if the length of target does not equal the size of this set.
      Since:
      19.0
    • toHashSet

      default HashSet<E> toHashSet()
    • toList

      default List<E> toList()
    • containsAll

      default boolean containsAll(Iterable<? extends E> coll)
    • removeIf

      default boolean removeIf(Predicate<? super E> filter)