Package org.apache.jena.mem
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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
add(Triple t)
Addt
to the triples in this bunch.boolean
contains(Triple t)
Answer true iff this TripleBunch contains a triple .equals tot
.boolean
containsBySameValueAs(Triple t)
Answer true iff this TripleBunch contains a triple with .sameValueAs subject, predicate, and object.ExtendedIterator<Triple>
iterator()
Answer an iterator over all the triples in this bunch.ExtendedIterator<Triple>
iterator(HashCommon.NotifyEmpty container)
Answer an iterator over all the triples in this bunch.void
remove(Triple t)
Removet
from the triples in this bunch.int
size()
Answer the number of triples in this bunch.
-
-
-
Method Detail
-
contains
boolean contains(Triple t)
Answer true iff this TripleBunch contains a triple .equals tot
.
-
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)
Addt
to the triples in this bunch. Ift
is already a member, nothing happens. The bunch now .contains this triple.
-
remove
void remove(Triple t)
Removet
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, theemptied
method ofcontainer
is invoked.
-
-