story.scheherazade.elements
Class TimelineIndex

java.lang.Object
  extended by story.scheherazade.elements.TimelineIndex

public class TimelineIndex
extends java.lang.Object

TimelineIndex allows storage and random access of Timeline objects. (Note the distinction to TimelineRepository, which stores underlying db-core Timeline nodes by implementing db-core's Repository interface.)

Essentially a wrapper for a hashtable keying Timeline objects to TimelineIDs. This class is only meant to be instantiated and handled by a Document.


Constructor Summary
TimelineIndex()
           
 
Method Summary
 void addTimeline(TimelineID ID, Timeline timeline)
          Add a Timeline to the index.
 boolean containsTimeline(TimelineID ID)
          Does this index contain a paritcular Timeline?
 java.util.Enumeration getAllTimelines()
          Return an Enumeration of all Timelines in the index.
 Timeline getTimeline(TimelineID ID)
          Get a Timeline from the index.
 TimelineIndex makeCopy()
          Make a copy of the index.
 int numberOfTimelines()
          Retrieve the number of Timelines in the index
 void removeTimeline(TimelineID ID)
          Remove a Timeline from the index.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimelineIndex

public TimelineIndex()
Method Detail

addTimeline

public void addTimeline(TimelineID ID,
                        Timeline timeline)
                 throws Scheherexception
Add a Timeline to the index.

Throws:
Scheherexception

getTimeline

public Timeline getTimeline(TimelineID ID)
                     throws Scheherexception
Get a Timeline from the index.

Throws:
Scheherexception

removeTimeline

public void removeTimeline(TimelineID ID)
                    throws Scheherexception
Remove a Timeline from the index.

Throws:
Scheherexception

numberOfTimelines

public int numberOfTimelines()
Retrieve the number of Timelines in the index


getAllTimelines

public java.util.Enumeration getAllTimelines()
Return an Enumeration of all Timelines in the index. This ought to be read-only; I don't mean to expose the internal Hashtable.


containsTimeline

public boolean containsTimeline(TimelineID ID)
Does this index contain a paritcular Timeline?


makeCopy

public TimelineIndex makeCopy()
Make a copy of the index.



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