Class TmfEventsCache
java.lang.Object
org.eclipse.tracecompass.tmf.ui.viewers.events.TmfEventsCache
The generic TMF Events table events cache
This can help avoid re-reading the trace when the user scrolls a window,
for example.
- Author:
- Patrick Tasse
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe generic TMF Events table cached event. -
Constructor Summary
ConstructorsConstructorDescriptionTmfEventsCache(int cacheSize, TmfEventsTable table) Constructor for the event cache -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyFilter(ITmfFilter filter, boolean collapseFilterEnabled) Apply a filter on this event cache.voidclear()Clear the current contents of this cache.voidClear the current filter on this cache.getEvent(int index) Get an event from the cache.intgetFilteredEventIndex(long rank) Get the cache index of an event from his rank in the trace.peekEvent(int index) Peek an event in the cache.voidAssign a new trace to this events cache.voidstoreEvent(ITmfEvent event, long rank, int index) Add a trace event to the cache.voidupdateCollapsedEvent(int index) Update event repeat count at index
-
Constructor Details
-
TmfEventsCache
Constructor for the event cache- Parameters:
cacheSize- The size of the cache, in number of eventstable- The Events table this cache will cover
-
-
Method Details
-
setTrace
Assign a new trace to this events cache. This clears the current contents.- Parameters:
trace- The trace to assign.
-
clear
public void clear()Clear the current contents of this cache. -
applyFilter
Apply a filter on this event cache. This clears the current cache contents.- Parameters:
filter- The ITmfFilter to apply.collapseFilterEnabled- true if the collapse filter is enabled- Since:
- 2.0
-
clearFilter
public void clearFilter()Clear the current filter on this cache. This also clears the current cache contents. -
getEvent
Get an event from the cache. If the cache does not contain the event, a cache population request is triggered.- Parameters:
index- The index of this event in the cache- Returns:
- The cached event, or 'null' if the event is not in the cache
-
peekEvent
Peek an event in the cache. Does not trigger cache population.- Parameters:
index- Index of the event to peek- Returns:
- The cached event, or 'null' if the event is not in the cache
-
storeEvent
Add a trace event to the cache.- Parameters:
event- The original trace event to be cachedrank- The rank of this event in the traceindex- The index this event will occupy in the cache
-
updateCollapsedEvent
public void updateCollapsedEvent(int index) Update event repeat count at index- Parameters:
index- The index this event occupies in the cache
-
getFilteredEventIndex
public int getFilteredEventIndex(long rank) Get the cache index of an event from his rank in the trace. This will take in consideration any filter that might be applied.- Parameters:
rank- The rank of the event in the trace- Returns:
- The position (index) this event should use once cached
-