Class AbstractResultHolder

java.lang.Object
pascal.taie.util.AbstractResultHolder
All Implemented Interfaces:
ResultHolder
Direct Known Subclasses:
DefaultIR, JClass, PointerAnalysisResultImpl, World

public abstract class AbstractResultHolder extends Object implements ResultHolder
Map-based implementation for ResultHolder.
  • Constructor Details

    • AbstractResultHolder

      public AbstractResultHolder()
  • Method Details

    • storeResult

      public <R> void storeResult(String key, R result)
      Description copied from interface: ResultHolder
      Stores the analysis result with the key.
      Specified by:
      storeResult in interface ResultHolder
    • hasResult

      public boolean hasResult(String key)
      Specified by:
      hasResult in interface ResultHolder
      Returns:
      true if the holder contains the result for given id.
    • getResult

      public <R> R getResult(String key)
      Description copied from interface: ResultHolder
      Given a key, returns the corresponding results.
      Specified by:
      getResult in interface ResultHolder
    • getResult

      public <R> R getResult(String key, R defaultResult)
      Description copied from interface: ResultHolder
      If this holder contains the result for given key, then returns the result; otherwise, return the given default result.
      Specified by:
      getResult in interface ResultHolder
    • getResult

      public <R> R getResult(String key, Supplier<R> supplier)
      Description copied from interface: ResultHolder
      If this holder contains the result for given key, then returns the result; otherwise, supplier is used to create a result, which is stored in the holder, and returned as the result of the call.
      Specified by:
      getResult in interface ResultHolder
    • getKeys

      public Collection<String> getKeys()
      Specified by:
      getKeys in interface ResultHolder
      Returns:
      all keys in the holder.
    • clearResult

      public void clearResult(String key)
      Description copied from interface: ResultHolder
      Clears result of the analysis specified by given key.
      Specified by:
      clearResult in interface ResultHolder
    • clearAll

      public void clearAll()
      Description copied from interface: ResultHolder
      Clears all cached results.
      Specified by:
      clearAll in interface ResultHolder