Interface PersistenceObjectRegistry
-
- All Superinterfaces:
Cloneable<PersistenceObjectRegistry>,PersistenceObjectIdLookup,PersistenceObjectLookup,PersistenceSwizzlingLookup
- All Known Implementing Classes:
DefaultObjectRegistry
public interface PersistenceObjectRegistry extends PersistenceSwizzlingLookup, Cloneable<PersistenceObjectRegistry>
A registry type for biunique associations of arbitrary objects with ids.
-
-
Method Summary
Modifier and Type Method Description longcapacity()Returns the current size potential before a (maybe costly) rebuild becomes necessary.voidclear()Clears all entries except those that are essential for a correctly executed program (e.g.voidclearAll()Clears all entries, including those that are essential for a correctly executed program (e.g.PersistenceObjectRegistryClone()Useful forPersistenceContextDispatcher.booleanconsolidate()Consolidate internal data structures, e.g.booleancontainsObjectId(long objectId)XGettingTable<String,? extends HashStatistics>createHashStatistics()booleanensureCapacity(long capacity)Makes sure the internal storage structure is prepared to provide acapacity()of at least the passed capacity value.floathashDensity()inthashRange()booleanisEmpty()<A extends PersistenceAcceptor>
AiterateEntries(A acceptor)ObjectlookupObject(long objectId)longlookupObjectId(Object object)longminimumCapacity()static DefaultObjectRegistryNew()ObjectoptionalRegisterObject(long objectId, Object object)booleanregisterConstant(long objectId, Object constant)booleanregisterObject(long objectId, Object object)booleansetConfiguration(float hashDensity, long minimumCapacity)booleansetHashDensity(float hashDensity)booleansetMinimumCapacity(long minimumCapacity)longsize()voidtruncate()Truncates all entries except those that are essential for a correctly executed program (e.g.voidtruncateAll()Truncates all entries, including those that are essential for a correctly executed program (e.g.
-
-
-
Method Detail
-
Clone
PersistenceObjectRegistry Clone()
Useful forPersistenceContextDispatcher.- Specified by:
Clonein interfaceCloneable<PersistenceObjectRegistry>- Returns:
- A Clone of this instance as described in
Cloneable.
-
lookupObjectId
long lookupObjectId(Object object)
- Specified by:
lookupObjectIdin interfacePersistenceObjectIdLookup
-
lookupObject
Object lookupObject(long objectId)
- Specified by:
lookupObjectin interfacePersistenceObjectLookup
-
containsObjectId
boolean containsObjectId(long objectId)
-
iterateEntries
<A extends PersistenceAcceptor> A iterateEntries(A acceptor)
-
size
long size()
-
isEmpty
boolean isEmpty()
-
hashRange
int hashRange()
-
hashDensity
float hashDensity()
-
minimumCapacity
long minimumCapacity()
-
capacity
long capacity()
Returns the current size potential before a (maybe costly) rebuild becomes necessary.
-
setHashDensity
boolean setHashDensity(float hashDensity)
-
setMinimumCapacity
boolean setMinimumCapacity(long minimumCapacity)
-
setConfiguration
boolean setConfiguration(float hashDensity, long minimumCapacity)
-
ensureCapacity
boolean ensureCapacity(long capacity)
Makes sure the internal storage structure is prepared to provide acapacity()of at least the passed capacity value.- Parameters:
capacity-- Returns:
- whether a rebuild of internal storage structures was necessary.
-
registerObject
boolean registerObject(long objectId, Object object)
-
registerConstant
boolean registerConstant(long objectId, Object constant)
-
consolidate
boolean consolidate()
Consolidate internal data structures, e.g. by removing orphan entries and empty hash chains. Depending on the implementation and the size of the registry, this can take a considerable amount of time.- Returns:
- whether a rebuild was required.
-
clear
void clear()
Clears all entries except those that are essential for a correctly executed program (e.g. constants). Clearing means to leave the current capacity as it is and just to actually clear its entries.
-
clearAll
void clearAll()
Clears all entries, including those that are essential for a correctly executed program (e.g. constants), effectively leaving a completely empty registry. Clearing means to leave the current capacity as it is and just to actually clear its entries.
-
truncate
void truncate()
Truncates all entries except those that are essential for a correctly executed program (e.g. constants). Truncating means to quickly empty the registry by reinitializing the internal storage structures with a new and minimal capacity.
-
truncateAll
void truncateAll()
Truncates all entries, including those that are essential for a correctly executed program (e.g. constants), effectively leaving a completely empty registry. Truncating means to quickly empty the registry by reinitializing the internal storage structures with a new and minimal capacity.
-
createHashStatistics
XGettingTable<String,? extends HashStatistics> createHashStatistics()
-
New
static DefaultObjectRegistry New()
-
-