public class MeasuredResultCache
extends java.lang.Object
Constructor and Description |
---|
MeasuredResultCache() |
MeasuredResultCache(MeasuredResultCache delegateCache)
Create a new MeasureResultCache with a delegate cache.
|
Modifier and Type | Method and Description |
---|---|
void |
addCachedResult(Component component,
LithoNode node,
LithoLayoutResult layoutResult)
Add a cached result to the cache.
|
void |
addCachedResult(int componentId,
LithoNode node,
LithoLayoutResult layoutResult)
Add a cached result to the cache.
|
void |
clearCache(Component component)
Cleares the cache generated for the given component.
|
void |
clearCache(int componentId)
Cleares the cache generated for the given component ID.
|
void |
freezeCache()
Marks this cache as frozen, meaning it is illegal to write new values into it, and should be
used as read-only.
|
LithoNode |
getCachedNode(Component component)
Returns the cached LithoNode from a given component.
|
LithoNode |
getCachedNode(int componentId)
Returns the cached LithoNode from a given component ID.
|
LithoLayoutResult |
getCachedResult(Component component)
Returns the cached layout result for the given component, or null if it does not exist.
|
LithoLayoutResult |
getCachedResult(int componentId)
Returns the cached layout result for the given component ID, or null if it does not exist.
|
LithoLayoutResult |
getCachedResult(LithoNode node)
Returns the cached layout result for the given node, or null if it does not exist.
|
boolean |
hasCachedNode(Component component)
Return true if there exists a cached layout result for the given component.
|
boolean |
hasCachedNode(int componentId)
Return true if there exists a cached layout result for the given component ID.
|
boolean |
hasCachedNode(LithoNode node)
Return true if there exists a cached layout result for the given LithoNode.
|
public MeasuredResultCache()
public MeasuredResultCache(MeasuredResultCache delegateCache)
public void freezeCache()
public void addCachedResult(Component component, LithoNode node, LithoLayoutResult layoutResult)
component
- The component from which the result was generatednode
- The node generated from the componentlayoutResult
- The layout resultpublic void addCachedResult(int componentId, LithoNode node, LithoLayoutResult layoutResult)
componentId
- The component ID from which the result was generatednode
- The node generated from the componentlayoutResult
- The layout resultpublic boolean hasCachedNode(Component component)
public boolean hasCachedNode(int componentId)
public boolean hasCachedNode(LithoNode node)
public LithoNode getCachedNode(Component component)
public LithoNode getCachedNode(int componentId)
public LithoLayoutResult getCachedResult(Component component)
public LithoLayoutResult getCachedResult(int componentId)
public LithoLayoutResult getCachedResult(LithoNode node)
public void clearCache(Component component)
public void clearCache(int componentId)