Interface JenaSet<E>

Type Parameters:
E - the element type of the set
All Superinterfaces:
Iterable<E>, JenaMapSetCommon<E>, Sized
All Known Subinterfaces:
FastTripleBunch, JenaSetHashOptimized<E>, JenaSetIndexed<E>, NodeToTriplesMap, TripleBunch
All Known Implementing Classes:
ArrayBunch, FastArrayBunch, FastHashedTripleBunch, FastHashSet, HashCommonSet, HashedTripleBunch, NodeToTriplesMapMem, TripleSet, TripleSet

public interface JenaSet<E> extends JenaMapSetCommon<E>, Iterable<E>
Set interface specialized for the use cases in triple-store implementations. Not thread-safe; does not allow null elements.
  • Method Details

    • tryAdd

      boolean tryAdd(E key)
      Add the key to the set if it is not already present.
      Parameters:
      key - the key to add. (null is not allowed)
      Returns:
      true if the key was added, false if it was already present
    • addUnchecked

      void addUnchecked(E key)
      Add the key to the set without checking whether it is already present.

      Attention: this method must only be used if the caller has ensured that the key is not already in the set; otherwise the set's invariants will break (duplicates may be inserted).

      Parameters:
      key - the key to add. (null is not allowed)
    • forEach

      default void forEach(Consumer<? super E> action)
      Specified by:
      forEach in interface Iterable<E>
    • spliterator

      default Spliterator<E> spliterator()
      Specified by:
      spliterator in interface Iterable<E>
    • iterator

      default @NonNull Iterator<E> iterator()
      Specified by:
      iterator in interface Iterable<E>