Class HashedTripleBunch

java.lang.Object
org.apache.jena.mem.HashCommon<Triple>
org.apache.jena.mem.HashedTripleBunch
All Implemented Interfaces:
TripleBunch

public class HashedTripleBunch extends HashCommon<Triple> implements TripleBunch
  • Constructor Details

    • HashedTripleBunch

      public HashedTripleBunch(TripleBunch b)
  • Method Details

    • contains

      public boolean contains(Triple t)
      Description copied from interface: TripleBunch
      Answer true iff this TripleBunch contains a triple .equals to t.
      Specified by:
      contains in interface TripleBunch
    • containsBySameValueAs

      public boolean containsBySameValueAs(Triple t)
      Description copied from interface: TripleBunch
      Answer true iff this TripleBunch contains a triple with .sameValueAs subject, predicate, and object. (Typically this only matters for the object. For example, integer literals with different numbers of leading zeroes can be .sameValueAs but not .equals).
      Specified by:
      containsBySameValueAs in interface TripleBunch
    • size

      public int size()
      Answer the number of items currently in this TripleBunch.
      Specified by:
      size in interface TripleBunch
      See Also:
    • currentCapacity

      public int currentCapacity()
      Answer the current capacity of this HashedTripleBunch; for testing purposes only. [Note that the bunch is resized when it is more than half-occupied.]
    • add

      public void add(Triple t)
      Description copied from interface: TripleBunch
      Add t to the triples in this bunch. If t is already a member, nothing happens. The bunch now .contains this triple.
      Specified by:
      add in interface TripleBunch
    • remove

      public void remove(Triple t)
      Description copied from class: HashCommon
      Remove the object key from this hash's keys if it is present (if it's absent, do nothing). If a key is removed, the removeAssociatedValues will be invoked. If a key is moved, the moveAssociatedValues method will be called.
      Specified by:
      remove in interface TripleBunch
      Overrides:
      remove in class HashCommon<Triple>
    • iterator

      public ExtendedIterator<Triple> iterator()
      Description copied from interface: TripleBunch
      Answer an iterator over all the triples in this bunch. It is unwise to .remove from this iterator. (It may become illegal.)
      Specified by:
      iterator in interface TripleBunch
    • iterator

      public ExtendedIterator<Triple> iterator(HashCommon.NotifyEmpty container)
      Description copied from interface: TripleBunch
      Answer an iterator over all the triples in this bunch. If use of .remove on this iterator empties the bunch, the emptied method of container is invoked.
      Specified by:
      iterator in interface TripleBunch
    • spliterator

      public Spliterator<Triple> spliterator()
      Description copied from interface: TripleBunch
      Answer a spliterator over all the triples in this bunch.
      Specified by:
      spliterator in interface TripleBunch