Package org.kigalisim.engine.state
Class SimpleUseKey
java.lang.Object
org.kigalisim.engine.state.SimpleUseKey
- All Implemented Interfaces:
UseKey
Simple implementation of UseKey that generates keys based on application and substance.
This class provides a lightweight way to generate keys for substance streams without requiring a full Scope object. The key generation follows the same pattern as Scope, using lazy initialization and caching for performance.
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleUseKey(String application, String substance) Creates a new SimpleUseKey with the specified application and substance. -
Method Summary
Modifier and TypeMethodDescriptionGet the application name.getKey()Gets the key string used to identify substance streams.Get the substance name.
-
Constructor Details
-
SimpleUseKey
Creates a new SimpleUseKey with the specified application and substance.- Parameters:
application- The application name, or null if not specifiedsubstance- The substance name, or null if not specified
-
-
Method Details
-
getKey
Gets the key string used to identify substance streams.The key is lazily initialized and cached. It consists of the application and substance names separated by a tab character, with "-" used for null values.
-
getApplication
Description copied from interface:UseKeyGet the application name.- Specified by:
getApplicationin interfaceUseKey- Returns:
- The application name in which the substance is used.
-
getSubstance
Description copied from interface:UseKeyGet the substance name.- Specified by:
getSubstancein interfaceUseKey- Returns:
- The name of the substance consumed in the application.
-