Class NodeToTriplesMapMem

java.lang.Object
org.apache.jena.mem2.store.legacy.NodeToTriplesMapMem
All Implemented Interfaces:
JenaMapSetCommon<Triple>, JenaSet<Triple>, NodeToTriplesMap

public class NodeToTriplesMapMem extends Object implements NodeToTriplesMap
  • Constructor Details

  • Method Details

    • clear

      public void clear()
      Description copied from interface: JenaMapSetCommon
      Clear the collection.
      Specified by:
      clear in interface JenaMapSetCommon<Triple>
    • size

      public int size()
      Specified by:
      size in interface JenaMapSetCommon<Triple>
      Returns:
      the number of elements in the collection
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface JenaMapSetCommon<Triple>
      Returns:
      true if the collection is empty
    • tryAdd

      public boolean tryAdd(Triple t)
      Description copied from interface: JenaSet
      Add the key to the set if it is not already present.
      Specified by:
      tryAdd in interface JenaSet<Triple>
      Parameters:
      t - the key to add
      Returns:
      true if the key was added, false if it was already present
    • addUnchecked

      public void addUnchecked(Triple t)
      Description copied from interface: JenaSet
      Add the key to the set without checking if it is already present. Attention: This method must only be used if it is guaranteed that the key is not already present.
      Specified by:
      addUnchecked in interface JenaSet<Triple>
      Parameters:
      t - the key to add
    • tryRemove

      public boolean tryRemove(Triple t)
      Description copied from interface: JenaMapSetCommon
      Tries to remove a key from the collection.
      Specified by:
      tryRemove in interface JenaMapSetCommon<Triple>
      Parameters:
      t - the key to remove
      Returns:
      true if the key was removed. If the key was not present, false is returned.
    • removeUnchecked

      public void removeUnchecked(Triple t)
      Description copied from interface: JenaMapSetCommon
      Removes a key from the collection. Attention: Implementations may assume that the key is present.
      Specified by:
      removeUnchecked in interface JenaMapSetCommon<Triple>
      Parameters:
      t - the key to remove
    • keyIterator

      public ExtendedIterator<Triple> keyIterator()
      Description copied from interface: JenaMapSetCommon
      Get an iterator over the keys in the collection.
      Specified by:
      keyIterator in interface JenaMapSetCommon<Triple>
      Returns:
      an iterator over the keys in the collection
    • keySpliterator

      public Spliterator<Triple> keySpliterator()
      Description copied from interface: JenaMapSetCommon
      Get a spliterator over the keys in the collection.
      Specified by:
      keySpliterator in interface JenaMapSetCommon<Triple>
      Returns:
      a spliterator over the keys in the collection
    • keyStream

      public Stream<Triple> keyStream()
      Description copied from interface: JenaMapSetCommon
      Get a stream over the keys in the collection.
      Specified by:
      keyStream in interface JenaMapSetCommon<Triple>
      Returns:
      a stream over the keys in the collection
    • iteratorForMatches

      public ExtendedIterator<Triple> iteratorForMatches(Node index, Node n2, Node n3)
      Description copied from interface: NodeToTriplesMap
      Answer an iterator over all the triples in this map that match the pattern.
      Specified by:
      iteratorForMatches in interface NodeToTriplesMap
      Parameters:
      index - The node to match as key.
      n2 - A node to match, or Node.ANY.
      n3 - A node to match, or Node.ANY.
      Returns:
      An iterator over all the triples in this map that match the pattern.
    • streamForMatches

      public Stream<Triple> streamForMatches(Node index, Node n2, Node n3)
      Description copied from interface: NodeToTriplesMap
      Answer a stream over all the triples in this map that match the pattern.
      Specified by:
      streamForMatches in interface NodeToTriplesMap
      Parameters:
      index - The node to match as key.
      n2 - A node to match, or Node.ANY.
      n3 - A node to match, or Node.ANY.
      Returns:
      A stream over all the triples in this map that match the pattern.
    • containsMatch

      public boolean containsMatch(Node index, Node n2, Node n3)
      Description copied from interface: NodeToTriplesMap
      Answer true iff this map contains a triple that matches the pattern.
      Specified by:
      containsMatch in interface NodeToTriplesMap
      Parameters:
      index - The node to match as key.
      n2 - A node to match, or Node.ANY.
      n3 - A node to match, or Node.ANY.
      Returns:
      True iff this map contains a triple that matches the pattern.
    • copy

      public NodeToTriplesMapMem copy()
      Description copied from interface: NodeToTriplesMap
      Create a copy of this map. The new map will contain all the same nodes as keys of this map, but copies of the bunches as values.
      Specified by:
      copy in interface NodeToTriplesMap
      Returns:
      an independent copy of this map
    • containsKey

      public boolean containsKey(Triple triple)
      Description copied from interface: JenaMapSetCommon
      Check whether the collection contains a given key.
      Specified by:
      containsKey in interface JenaMapSetCommon<Triple>
      Parameters:
      triple - the key to look for
      Returns:
      true if the collection contains the key
    • anyMatch

      public boolean anyMatch(Predicate<Triple> predicate)
      Description copied from interface: JenaMapSetCommon
      Check whether the collection contains any element matching the predicate.
      Specified by:
      anyMatch in interface JenaMapSetCommon<Triple>
      Parameters:
      predicate - the predicate to match
      Returns:
      true if the collection contains any element matching the predicate