Class StructureRegistry
java.lang.Object
nl.pim16aap2.animatedarchitecture.core.structures.StructureRegistry
- All Implemented Interfaces:
IDebuggable, StructureDeletionManager.IDeletionListener
@Singleton
public final class StructureRegistry
extends Object
implements IDebuggable, StructureDeletionManager.IDeletionListener
Represents a registry of structures.
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionGets the debug information for this object.getRegisteredStructure(long structureUID) Attempts to get theStructureassociated the given UID.booleanisRegistered(long structureUID) Checks if aStructureassociated with a given UID has been registered.booleanisRegistered(Structure structure) Checks if the exact instance of the providedStructurehas been registered.voidonStructureDeletion(IStructureConst structure) Called when a structure is deleted.putIfAbsent(Structure structure) Puts a newStructurein the cache if it does not exist yet.static StructureRegistryunCached(DebuggableRegistry debuggableRegistry, StructureDeletionManager structureDeletionManager) Creates a newStructureRegistrywithout any caching.
-
Field Details
-
CACHE_EXPIRY
-
-
Method Details
-
unCached
public static StructureRegistry unCached(DebuggableRegistry debuggableRegistry, StructureDeletionManager structureDeletionManager) Creates a newStructureRegistrywithout any caching.- Returns:
- The new
StructureRegistry.
-
onStructureDeletion
Description copied from interface:StructureDeletionManager.IDeletionListenerCalled when a structure is deleted.- Specified by:
onStructureDeletionin interfaceStructureDeletionManager.IDeletionListener- Parameters:
structure- The structure that was deleted.
-
getRegisteredStructure
-
isRegistered
-
isRegistered
-
putIfAbsent
-
getDebugInformation
Description copied from interface:IDebuggableGets the debug information for this object.- Specified by:
getDebugInformationin interfaceIDebuggable- Returns:
- The debug information or null if there's nothing to log at this time.
-