orc.trace
Class WeakBackwardEventCursor

java.lang.Object
  extended by orc.trace.WeakBackwardEventCursor
All Implemented Interfaces:
EventCursor

public class WeakBackwardEventCursor
extends java.lang.Object
implements EventCursor

Wrap a cursor to provide weak back references. This means you can only traverse back to the earliest cursor for which you hold a reference externally.

Author:
quark

Nested Class Summary
 
Nested classes/interfaces inherited from interface orc.trace.EventCursor
EventCursor.EndOfStream
 
Constructor Summary
WeakBackwardEventCursor(EventCursor cursor)
           
 
Method Summary
 WeakBackwardEventCursor backward()
          Return a cursor to the previous event in the stream.
 Event current()
          Return the current event in the stream.
 WeakBackwardEventCursor forward()
          Return a cursor to the next event in the stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WeakBackwardEventCursor

public WeakBackwardEventCursor(EventCursor cursor)
Method Detail

current

public Event current()
Description copied from interface: EventCursor
Return the current event in the stream.

Specified by:
current in interface EventCursor

forward

public WeakBackwardEventCursor forward()
                                throws EventCursor.EndOfStream
Description copied from interface: EventCursor
Return a cursor to the next event in the stream. Why "forward" instead of "next"? To avoid confusion with the temporal logic "next" operator which evaluates a predicate at the next location. Also because I prefer the symmetry of forward/backward to next/previous.

Specified by:
forward in interface EventCursor
Throws:
EventCursor.EndOfStream

backward

public WeakBackwardEventCursor backward()
                                 throws EventCursor.EndOfStream
Description copied from interface: EventCursor
Return a cursor to the previous event in the stream.

Specified by:
backward in interface EventCursor
Throws:
EventCursor.EndOfStream