java.lang.Object
org.apache.jena.mem.ArrayBunch
- All Implemented Interfaces:
TripleBunch
An ArrayBunch implements TripleBunch with a linear search of a short-ish
array of Triples. The array can grow, but it only grows by 4 elements each time
(because, if it gets big enough for this linear growth to be bad, it should anyways
have been replaced by a more efficient set-of-triples implementation).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAddtto the triples in this bunch.booleanAnswer true iff this TripleBunch contains a triple .equals tot.booleanAnswer true iff this TripleBunch contains a triple with .sameValueAs subject, predicate, and object.iterator()Answer an iterator over all the triples in this bunch.iterator(HashCommon.NotifyEmpty container) Answer an iterator over all the triples in this bunch.voidRemovetfrom the triples in this bunch.intsize()Answer the number of triples in this bunch.Answer a spliterator over all the triples in this bunch.
-
Constructor Details
-
ArrayBunch
public ArrayBunch()
-
-
Method Details
-
containsBySameValueAs
Description copied from interface:TripleBunchAnswer 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:
containsBySameValueAsin interfaceTripleBunch
-
contains
Description copied from interface:TripleBunchAnswer true iff this TripleBunch contains a triple .equals tot.- Specified by:
containsin interfaceTripleBunch
-
size
public int size()Description copied from interface:TripleBunchAnswer the number of triples in this bunch.- Specified by:
sizein interfaceTripleBunch
-
add
Description copied from interface:TripleBunchAddtto the triples in this bunch. Iftis already a member, nothing happens. The bunch now .contains this triple.- Specified by:
addin interfaceTripleBunch
-
remove
Description copied from interface:TripleBunchRemovetfrom the triples in this bunch. If it wasn't a member, nothing happens. The bunch no longer .contains this triple.- Specified by:
removein interfaceTripleBunch
-
iterator
Description copied from interface:TripleBunchAnswer an iterator over all the triples in this bunch. It is unwise to .remove from this iterator. (It may become illegal.)- Specified by:
iteratorin interfaceTripleBunch
-
iterator
Description copied from interface:TripleBunchAnswer an iterator over all the triples in this bunch. If use of .remove on this iterator empties the bunch, theemptiedmethod ofcontaineris invoked.- Specified by:
iteratorin interfaceTripleBunch
-
spliterator
Description copied from interface:TripleBunchAnswer a spliterator over all the triples in this bunch.- Specified by:
spliteratorin interfaceTripleBunch
-