Package org.apache.jena.mem
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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.jena.mem.HashCommon
HashCommon.NotifyEmpty
-
-
Field Summary
-
Fields inherited from class org.apache.jena.mem.HashCommon
capacity
-
-
Constructor Summary
Constructors Constructor Description HashedTripleBunch(TripleBunch b)
-
Method Summary
All Methods Instance Methods Concrete 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.int
currentCapacity()
Answer the current capacity of this HashedTripleBunch; for testing purposes only.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)
Remove the objectkey
from this hash's keys if it is present (if it's absent, do nothing).int
size()
Answer the number of items currently in this TripleBunch.-
Methods inherited from class org.apache.jena.mem.HashCommon
getItemForTestingAt, keyIterator, keyIterator
-
-
-
-
Constructor Detail
-
HashedTripleBunch
public HashedTripleBunch(TripleBunch b)
-
-
Method Detail
-
contains
public boolean contains(Triple t)
Description copied from interface:TripleBunch
Answer true iff this TripleBunch contains a triple .equals tot
.- Specified by:
contains
in interfaceTripleBunch
-
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 interfaceTripleBunch
-
size
public int size()
Answer the number of items currently in this TripleBunch.- Specified by:
size
in interfaceTripleBunch
- See Also:
TripleBunch.size()
-
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
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
public void remove(Triple t)
Description copied from class:HashCommon
Remove the objectkey
from this hash's keys if it is present (if it's absent, do nothing). If a key is removed, theremoveAssociatedValues
will be invoked. If a key is moved, themoveAssociatedValues
method will be called.- Specified by:
remove
in interfaceTripleBunch
- Overrides:
remove
in classHashCommon<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 interfaceTripleBunch
-
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, theemptied
method ofcontainer
is invoked.- Specified by:
iterator
in interfaceTripleBunch
-
-