Package org.apache.jena.mem
Class HashedBunchMap
- java.lang.Object
-
- org.apache.jena.mem.HashCommon<java.lang.Object>
-
- org.apache.jena.mem.HashedBunchMap
-
- All Implemented Interfaces:
BunchMap
public class HashedBunchMap extends HashCommon<java.lang.Object> implements BunchMap
An implementation of BunchMap that does open-addressed hashing.
-
-
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 HashedBunchMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clear this map: all entries are removed.TripleBunch
get(java.lang.Object key)
Answer the TripleBunch associated withkey
, ornull
if there isn't one.TripleBunch
getOrSet(java.lang.Object key, java.util.function.Function<java.lang.Object,TripleBunch> setter)
Get thekey
and return the value found there; if nothing, calculate thevalue
and insert.void
put(java.lang.Object key, TripleBunch value)
Associatekey
andvalue
.long
size()
The number of items in the bunch.-
Methods inherited from class org.apache.jena.mem.HashCommon
getItemForTestingAt, keyIterator, keyIterator, remove
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.jena.mem.BunchMap
keyIterator, remove
-
-
-
-
Method Detail
-
clear
public void clear()
Clear this map: all entries are removed. The keys and value array elements are set to null (so the values may be garbage-collected).
-
size
public long size()
Description copied from interface:BunchMap
The number of items in the bunch.
-
get
public TripleBunch get(java.lang.Object key)
Description copied from interface:BunchMap
Answer the TripleBunch associated withkey
, ornull
if there isn't one.
-
put
public void put(java.lang.Object key, TripleBunch value)
Description copied from interface:BunchMap
Associatekey
andvalue
. Any existing association ofkey
is lost.get
on this key will now deliver this value.
-
getOrSet
public TripleBunch getOrSet(java.lang.Object key, java.util.function.Function<java.lang.Object,TripleBunch> setter)
Description copied from interface:BunchMap
Get thekey
and return the value found there; if nothing, calculate thevalue
and insert. Return the value now the slot.
-
-