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.
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.
    boolean
    Returns true if this set contains no elements.
    int
    Returns the number of elements in this set.
    default E[]
    toArray(E[] target)
    Stores all of the elements in this set into target.

    Methods inherited from interface java.lang.Iterable

    forEach, iterator, spliterator
  • Method Details

    • contains

      boolean contains(E element)
      Returns true if this set contains a mapping for the element.
      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 of 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