Class SimpleUseKey

java.lang.Object
org.kigalisim.engine.state.SimpleUseKey
All Implemented Interfaces:
UseKey

public class SimpleUseKey extends Object implements 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 Details

    • SimpleUseKey

      public SimpleUseKey(String application, String substance)
      Creates a new SimpleUseKey with the specified application and substance.
      Parameters:
      application - The application name, or null if not specified
      substance - The substance name, or null if not specified
  • Method Details

    • getKey

      public String 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.

      Specified by:
      getKey in interface UseKey
      Returns:
      The unique key for this application/substance combination
    • getApplication

      public String getApplication()
      Description copied from interface: UseKey
      Get the application name.
      Specified by:
      getApplication in interface UseKey
      Returns:
      The application name in which the substance is used.
    • getSubstance

      public String getSubstance()
      Description copied from interface: UseKey
      Get the substance name.
      Specified by:
      getSubstance in interface UseKey
      Returns:
      The name of the substance consumed in the application.