com.jrockit.mc.flightrecorder.provider
Class EventStorage
java.lang.Object
com.jrockit.mc.flightrecorder.provider.EventStorage
public final class EventStorage
- extends java.lang.Object
Container that can hold events and iterate over them
Events can be added in O(n), instead of O*log(n) for an
ArrayList, and without the overhead associated LinkedList
.
Events can be added to the storage using either addInOrder(IEvent)
or addOutOfOrder(IEvent)
.
If you use the addOutOfOrder the storage will post process the events so they
are in a correct order when the first iterator is requested.
If you use the addInOrder version events and an event is added that doesn't
meet the constraints for the storage the event will not be added.
See TrackType
for constraints.
Note, once any other method than addInOrder(IEvent)
or
addOutOfOrder(IEvent)
no more events can be added to the
track.
FIXME: this class should be package private
- Author:
- Erik Gahlin
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EventStorage
public EventStorage(Track desc)
EventStorage
public EventStorage(Track desc,
TrackType type)
isEmpty
public boolean isEmpty()
iterator
public java.util.Iterator<IEvent> iterator(IEventFilter filter,
ITimeRange range,
Expansion rs)
- Once an iterator is requested no more data can be added to this
IRangeHolder without throwing away the old data.
iterator
public java.util.Iterator<IEvent> iterator()
- Once an iterator is requested no more data can be added to this
IRangeHolder without throwing away the old data.
addOutOfOrder
public void addOutOfOrder(IEvent event)
addInOrder
public boolean addInOrder(IEvent event)
clear
public void clear()
getFirst
public IEvent getFirst()
getLast
public IEvent getLast()
getType
public TrackType getType()
getTrack
public Track getTrack()
Copyright © 1999, 2011, Oracle and/or its affiliates. All rights reserved.