Package org.apache.jena.mem
Class ArrayBunch
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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Addt
to the triples in this bunch.boolean
Answer true iff this TripleBunch contains a triple .equals tot
.boolean
Answer 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.void
Removet
from the triples in this bunch.int
size()
Answer the number of triples in this bunch.
-
Constructor Details
-
ArrayBunch
public ArrayBunch()
-
-
Method Details
-
containsBySameValueAs
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 interfaceTripleBunch
-
contains
Description copied from interface:TripleBunch
Answer true iff this TripleBunch contains a triple .equals tot
.- Specified by:
contains
in interfaceTripleBunch
-
size
public int size()Description copied from interface:TripleBunch
Answer the number of triples in this bunch.- Specified by:
size
in interfaceTripleBunch
-
add
Description copied from interface:TripleBunch
Addt
to the triples in this bunch. Ift
is already a member, nothing happens. The bunch now .contains this triple.- Specified by:
add
in interfaceTripleBunch
-
remove
Description copied from interface:TripleBunch
Removet
from the triples in this bunch. If it wasn't a member, nothing happens. The bunch no longer .contains this triple.- Specified by:
remove
in interfaceTripleBunch
-
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 interfaceTripleBunch
-
iterator
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, theemptied
method ofcontainer
is invoked.- Specified by:
iterator
in interfaceTripleBunch
-