story.scheherazade.virgil
Class VirgilFile

java.lang.Object
  extended by story.scheherazade.virgil.VirgilFile
All Implemented Interfaces:
RenderableObject

public class VirgilFile
extends java.lang.Object
implements RenderableObject

Handles Virgil file I/O. Class represents a virgil memento, including Scheherazade StoryTelling and Virgil metadata on the higher level. Use it to load a Virgil story by using the file constructor and then the data access methods. Use it to save a file with the data constructor and save() method.


Field Summary
static java.lang.String CONFIG_KEY
           
static java.lang.String FILE_FORMAT_CONFIG_KEY
           
static java.lang.String SCH_SAVED_STORY
           
static java.lang.String SOURCE_STORY
           
static java.lang.String SOURCE_STORY_BELOW
           
static java.lang.String SOURCE_STORY_ID
           
static java.lang.String STORY_POINT
           
static java.lang.String STORY_POINTS
           
static java.lang.String TIMELINE_ID
           
static java.lang.String UID_ATT
           
static java.lang.String VISIBLE_STATES
           
static java.lang.String VISIBLE_STATES_SET
           
 
Constructor Summary
VirgilFile(java.io.File fileToOpen)
          Constructor for parsing (opening) from disk.
VirgilFile(StoryTelling telling, int tellingFloor, VisibleStates visibleStates, int configKey, java.lang.String UID, java.lang.String sourceStoryID, java.lang.String sourceStory)
          Constructor for populating with live data.
 
Method Summary
 boolean errorDuringParse()
          The data is NOT ready if we encountered a parse error during construction.
 int getConfigKey()
           
 java.io.File getFilename()
           
 Scheherexception getParseError()
           
 java.lang.String getSourceStory()
           
 java.lang.String getSourceStoryID()
           
 StoryTelling getStoryTelling()
           
 java.lang.String getUID()
           
 VisibleStates getVisibleStates()
           
 java.lang.StringBuffer render()
           
 void save(java.io.File fileToSave)
          Save the current Virgil memento to disk.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILE_FORMAT_CONFIG_KEY

public static final java.lang.String FILE_FORMAT_CONFIG_KEY
See Also:
Constant Field Values

SCH_SAVED_STORY

public static final java.lang.String SCH_SAVED_STORY
See Also:
Constant Field Values

SOURCE_STORY

public static final java.lang.String SOURCE_STORY
See Also:
Constant Field Values

VISIBLE_STATES_SET

public static final java.lang.String VISIBLE_STATES_SET
See Also:
Constant Field Values

VISIBLE_STATES

public static final java.lang.String VISIBLE_STATES
See Also:
Constant Field Values

STORY_POINTS

public static final java.lang.String STORY_POINTS
See Also:
Constant Field Values

STORY_POINT

public static final java.lang.String STORY_POINT
See Also:
Constant Field Values

SOURCE_STORY_BELOW

public static final java.lang.String SOURCE_STORY_BELOW
See Also:
Constant Field Values

CONFIG_KEY

public static final java.lang.String CONFIG_KEY
See Also:
Constant Field Values

UID_ATT

public static final java.lang.String UID_ATT
See Also:
Constant Field Values

SOURCE_STORY_ID

public static final java.lang.String SOURCE_STORY_ID
See Also:
Constant Field Values

TIMELINE_ID

public static final java.lang.String TIMELINE_ID
See Also:
Constant Field Values
Constructor Detail

VirgilFile

public VirgilFile(StoryTelling telling,
                  int tellingFloor,
                  VisibleStates visibleStates,
                  int configKey,
                  java.lang.String UID,
                  java.lang.String sourceStoryID,
                  java.lang.String sourceStory)
           throws Scheherexception
Constructor for populating with live data.

Throws:
Scheherexception

VirgilFile

public VirgilFile(java.io.File fileToOpen)
Constructor for parsing (opening) from disk.

Method Detail

save

public void save(java.io.File fileToSave)
          throws Scheherexception
Save the current Virgil memento to disk.

Throws:
Scheherexception

errorDuringParse

public boolean errorDuringParse()
The data is NOT ready if we encountered a parse error during construction. (Can't simply have the constructor throw an exception because of threading issues.)


getParseError

public Scheherexception getParseError()

getFilename

public java.io.File getFilename()

getVisibleStates

public VisibleStates getVisibleStates()
                               throws Scheherexception
Throws:
Scheherexception

getConfigKey

public int getConfigKey()

getStoryTelling

public StoryTelling getStoryTelling()
                             throws Scheherexception
Throws:
Scheherexception

getUID

public java.lang.String getUID()

getSourceStoryID

public java.lang.String getSourceStoryID()

render

public java.lang.StringBuffer render()
Specified by:
render in interface RenderableObject

getSourceStory

public java.lang.String getSourceStory()


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