Interface TripleBunch

  • All Known Implementing Classes:
    ArrayBunch, HashedTripleBunch, SetBunch

    public interface TripleBunch
    A bunch of triples - a stripped-down set with specialized methods. A bunch is expected to store triples that share some useful property (such as having the same subject or predicate).
    • Method Detail

      • contains

        boolean contains​(Triple t)
        Answer true iff this TripleBunch contains a triple .equals to t.
      • containsBySameValueAs

        boolean containsBySameValueAs​(Triple t)
        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).
      • size

        int size()
        Answer the number of triples in this bunch.
      • add

        void add​(Triple t)
        Add t to the triples in this bunch. If t is already a member, nothing happens. The bunch now .contains this triple.
      • remove

        void remove​(Triple t)
        Remove t from the triples in this bunch. If it wasn't a member, nothing happens. The bunch no longer .contains this triple.
      • iterator

        ExtendedIterator<Triple> iterator()
        Answer an iterator over all the triples in this bunch. It is unwise to .remove from this iterator. (It may become illegal.)
      • iterator

        ExtendedIterator<Triple> iterator​(HashCommon.NotifyEmpty container)
        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.