story.dbcore.admin
Class HistoryFrame

java.lang.Object
  extended by story.dbcore.admin.HistoryFrame

public class HistoryFrame
extends java.lang.Object

A History frame object encapsulates a particular state of the db-core by storing all the commands required to rebuild a Document from scratch. Used for implementing undo and redo.


Constructor Summary
HistoryFrame(HistoryFrameID HFID, DocumentID docID)
          Constructor for STATELESS MODE markers.
HistoryFrame(HistoryFrameID HFID, DocumentID docID, Executable executable, Executable undoSequence)
          Constructor for normal frames.
 
Method Summary
 DocumentID getDocument()
          Retrieve the ID of the Document the frame has recorded.
 Executable getExecutable()
          Retrieve the most recently issued Executable.
 HistoryFrameID getID()
          Retrieve the ID of the HistoryFrame
 Executable getUndoSequence()
          Return the Executable to reverse the effects of the most recently issued Executable.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HistoryFrame

public HistoryFrame(HistoryFrameID HFID,
                    DocumentID docID)
             throws Scheherexception
Constructor for STATELESS MODE markers.

Throws:
Scheherexception

HistoryFrame

public HistoryFrame(HistoryFrameID HFID,
                    DocumentID docID,
                    Executable executable,
                    Executable undoSequence)
             throws Scheherexception
Constructor for normal frames.

Parameters:
docID - The ID of the Document the frame records.
executable - The most recent executable issued. This is akin to a "tag" and not a part of the history proper.
memento - A CommandSequence of commands that would reconstruct the Document from scratch.
Throws:
Scheherexception
Method Detail

getID

public HistoryFrameID getID()
Retrieve the ID of the HistoryFrame


getDocument

public DocumentID getDocument()
Retrieve the ID of the Document the frame has recorded.


getExecutable

public Executable getExecutable()
Retrieve the most recently issued Executable. Warning: this can return a class of either Command or CommandSequence.


getUndoSequence

public Executable getUndoSequence()
Return the Executable to reverse the effects of the most recently issued Executable. Warning: this can return a class of either Command or CommandSequence.



Copyright © 2011 David K. Elson. All Rights Reserved.