java.lang.Object
de.uni_mannheim.informatik.dws.melt.matching_base.DataStore

public class DataStore extends Object
Store accessible to all matchers where variables and results can be persisted in. Available as local store and as global store.
  • Field Details

    • instance

      private static DataStore instance
      Singleton instance
    • centralStore

      private HashMap<String,Object> centralStore
      Central Store Object
  • Constructor Details

    • DataStore

      public DataStore()
      Constructor
    • DataStore

      public DataStore(Properties p)
      Initialize the Datastore with Properties
      Parameters:
      p - the properties to be populated.
  • Method Details

    • getGlobal

      public static DataStore getGlobal()
      Get global data store instance.
      Returns:
      Instance of the global data store.
    • put

      public void put(String key, Object value)
      Put an object to the data store.
      Parameters:
      key - Key
      value - Value
    • get

      public Object get(String key, Class<?> clazz)
      Get an object from the data store using a key.
      Parameters:
      key - Key used to retrieve object.
      clazz - The class.
      Returns:
      Value stored for key.
    • get

      public <T> T get(String key)
      This method does not cast the object, but the calling method. See also this stackoverflow question.
      Type Parameters:
      T - The generic parameter.
      Parameters:
      key - Key used to retrieve value.
      Returns:
      Value stored for key.
    • containsKey

      public boolean containsKey(String key)
      Check if key exists in store.
      Parameters:
      key - Key that shall be looked up.
      Returns:
      true if key contained, else false.
    • clear

      public void clear()
      Delete store.
    • toProperties

      public Properties toProperties()
      Transform this Datastore into a Properties object.
      Returns:
      the converted Properties object.