com.vaadin.flow.component.internal.
Class DependencyTreeCache<T>
- java.lang.Object
-
- com.vaadin.flow.component.internal.DependencyTreeCache<T>
-
Type Parameters:
T
- the value typeAll Implemented Interfaces:
public class DependencyTreeCache<T> extends Object implements Serializable
A caching tree traverser for collecting and parsing dependencies.
For internal use only. May be renamed or removed in a future release.
Since:
1.2
Author:
Vaadin Ltd
See Also:
-
-
Constructor Summary
Constructors Constructor Description DependencyTreeCache(SerializableFunction<T,Collection<T>> dependencyParser)
Creates a dependency cache with the given dependency parser.
-
Method Summary
All Methods Modifier and Type Method Description void
clear()
Clears all the contents of the cache.
Set<T>
getDependencies(T node)
Collects all transitive dependencies of the given node, including the node itself.
-
-
-
Constructor Detail
-
DependencyTreeCache
public DependencyTreeCache(SerializableFunction<T,Collection<T>> dependencyParser)
Creates a dependency cache with the given dependency parser.
Parameters:
dependencyParser
- a potentially slow callback function that finds the direct dependencies for any given value
-
-
Method Detail
-
getDependencies
public Set<T> getDependencies(T node)
Collects all transitive dependencies of the given node, including the node itself.
Parameters:
node
- the node for which to collect dependenciesReturns:
the transitive dependencies of the given node
-
clear
public void clear()
Clears all the contents of the cache. A lookup that is in progress while the cache is cleared may return a result that combines previously cached dependencies with newly parsed dependencies.
-
-