Class ThreadSafeSULCaches


  • public final class ThreadSafeSULCaches
    extends Object
    A factory for creating thread-safe SUL caches.
    • Method Detail

      • createCache

        public static <I,​O> ThreadSafeSULCache<I,​O> createCache​(Alphabet<I> alphabet,
                                                                            SUL<I,​O> sul)
        Wraps a given SUL in a thread-safe variant of a SULCache that supports forking iff the given SUL supports it.

        Note that this method does not specify the implementation to use for the cache. Currently, a DAG (createDAGCache(Alphabet, SUL)) is used; however, this may change in the future.

        Type Parameters:
        I - input symbol type
        O - output symbol type
        Parameters:
        alphabet - the alphabet containing the symbols of possible queries
        sul - the supplier that is used as a delegate, in case of a cache-miss.
        Returns:
        a ThreadSafeSULCache.
      • createDAGCache

        public static <I,​O> ThreadSafeSULCache<I,​O> createDAGCache​(Alphabet<I> alphabet,
                                                                               SUL<I,​O> sul)
        Wraps a given SUL in a thread-safe variant of a SULCache that supports forking iff the given SUL supports it and uses a DAG for internal cache organization.
        Type Parameters:
        I - input symbol type
        O - output symbol type
        Parameters:
        alphabet - the alphabet containing the symbols of possible queries
        sul - the supplier that is used as a delegate, in case of a cache-miss.
        Returns:
        a ThreadSafeSULCache.
        See Also:
        IncrementalMealyDAGBuilder
      • createTreeCache

        public static <I,​O> ThreadSafeSULCache<I,​O> createTreeCache​(Alphabet<I> alphabet,
                                                                                SUL<I,​O> sul)
        Wraps a given SUL in a thread-safe variant of a SULCache that supports forking iff the given SUL supports it and uses a tree for internal cache organization.
        Type Parameters:
        I - input symbol type
        O - output symbol type
        Parameters:
        alphabet - the alphabet containing the symbols of possible queries
        sul - the supplier that is used as a delegate, in case of a cache-miss.
        Returns:
        a ThreadSafeSULCache.
        See Also:
        IncrementalMealyTreeBuilder