Interface JenaMapSetCommon<E>

Type Parameters:
E - the type of the keys (or elements, for sets) in the collection
All Superinterfaces:
Sized
All Known Subinterfaces:
FastTripleBunch, JenaMap<K,V>, JenaMapIndexed<K,V>, JenaSet<E>, JenaSetHashOptimized<E>, JenaSetIndexed<E>, NodeToTriplesMap, TripleBunch
All Known Implementing Classes:
ArrayBunch, FastArrayBunch, FastHashBase, FastHashedBunchMap, FastHashedTripleBunch, FastHashMap, FastHashSet, HashCommonBase, HashCommonMap, HashCommonSet, HashedBunchMap, HashedTripleBunch, NodesToBitmapsMap, NodesToIndices, NodeToTriplesMapMem, TripleSet, TripleSet

public interface JenaMapSetCommon<E> extends Sized
Operations shared between the map (JenaMap) and the set (JenaSet) collections used in the mem triple store implementations.

These collections trade some flexibility for speed: they expose only the operations needed by triple-store internals (no full Map or Set contract). They are not thread-safe.

  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    anyMatch(Predicate<E> predicate)
    Check whether the collection contains any element matching the predicate.
    void
    Clear the collection.
    boolean
    Check whether the collection contains a given key.
    boolean
     
    Get an iterator over the keys in the collection.
    Get a spliterator over the keys in the collection.
    default Stream<E>
    Get a stream over the keys in the collection.
    default Stream<E>
    Get a parallel stream over the keys in the collection.
    void
    Removes a key from the collection.
    boolean
    tryRemove(E key)
    Tries to remove a key from the collection.

    Methods inherited from interface org.apache.jena.mem.collection.Sized

    size
  • Method Details

    • clear

      void clear()
      Clear the collection.
    • isEmpty

      boolean isEmpty()
      Returns:
      true if the collection is empty
    • containsKey

      boolean containsKey(E key)
      Check whether the collection contains a given key.
      Parameters:
      key - the key to look for
      Returns:
      true if the collection contains the key
    • anyMatch

      boolean anyMatch(Predicate<E> predicate)
      Check whether the collection contains any element matching the predicate.
      Parameters:
      predicate - the predicate to match
      Returns:
      true if the collection contains any element matching the predicate
    • tryRemove

      boolean tryRemove(E key)
      Tries to remove a key from the collection.
      Parameters:
      key - the key to remove
      Returns:
      true if the key was removed. If the key was not present, false is returned.
    • removeUnchecked

      void removeUnchecked(E key)
      Removes a key from the collection.

      Attention: implementations may assume the key is present and may produce undefined behavior (including silently corrupting internal state) if it is not. Use tryRemove(Object) when in doubt.

      Parameters:
      key - the key to remove
    • keyIterator

      ExtendedIterator<E> keyIterator()
      Get an iterator over the keys in the collection.
      Returns:
      an iterator over the keys in the collection
    • keySpliterator

      Spliterator<E> keySpliterator()
      Get a spliterator over the keys in the collection.
      Returns:
      a spliterator over the keys in the collection
    • keyStream

      default Stream<E> keyStream()
      Get a stream over the keys in the collection.
      Returns:
      a stream over the keys in the collection
    • keyStreamParallel

      default Stream<E> keyStreamParallel()
      Get a parallel stream over the keys in the collection.
      Returns:
      a parallel stream over the keys in the collection