story.scheherazade.elements
Class StateTime

java.lang.Object
  extended by story.scheherazade.elements.StateTime
All Implemented Interfaces:
java.lang.Comparable, RenderableObject, TimelineTime

public class StateTime
extends java.lang.Object
implements RenderableObject, java.lang.Comparable, TimelineTime

This class represents the time that a State occurs, including several variables, such as whether the time is concrete or relative to some other time, and if so, what time it is relative to.


Field Summary
static StateTime INTERP
           
static StateTime PROPERTY
           
static StateTime TIME_0
           
static StateTime TIME_1
           
static StateTime TIME_NEG1
           
static StateTime UNBOUNDED
           
static StateTime VIRTUAL
           
 
Constructor Summary
StateTime(StateTime prototype)
          Constructor that clones another StateTime.
StateTime(StateTimeType timeType, double timeIndex)
          Constructor for an absolute time.
StateTime(java.lang.String in)
          Constructor that parses information from a string.
 
Method Summary
 int compareTo(java.lang.Object other)
           
 int compareTo(StateTime other)
          Compares two StateTimes in a way consistent with other CompareTo functions in Java
 boolean equals(java.lang.Object otherObject)
          Determines if this StateTime is equivalent to another StateTime.
 double getTimeIndex()
          Returns the time index of the StateTime.
 StateTimeType getTimeType()
          Returns the StateTimeType of the StateTime.
 boolean greaterThan(StateTime other)
          Determines if this StateTime is greater than another StateTime.
 boolean hasTimeIndex()
          Returns whether this StateTime has a time index (i.e., is not Virtual or Unbounded)
 java.lang.StringBuffer render()
          Serialize the StateTime.
 java.lang.StringBuffer renderForHumans()
          Render the StateTime in a way that is not reinterpretable by the StateTime(String) constructor, but is nicer for humans to read.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TIME_0

public static final StateTime TIME_0

TIME_NEG1

public static final StateTime TIME_NEG1

TIME_1

public static final StateTime TIME_1

VIRTUAL

public static final StateTime VIRTUAL

UNBOUNDED

public static final StateTime UNBOUNDED

PROPERTY

public static final StateTime PROPERTY

INTERP

public static final StateTime INTERP
Constructor Detail

StateTime

public StateTime(StateTimeType timeType,
                 double timeIndex)
          throws Scheherexception
Constructor for an absolute time.

Throws:
Scheherexception

StateTime

public StateTime(StateTime prototype)
Constructor that clones another StateTime.


StateTime

public StateTime(java.lang.String in)
          throws Scheherexception
Constructor that parses information from a string.

Throws:
Scheherexception
Method Detail

equals

public boolean equals(java.lang.Object otherObject)
Determines if this StateTime is equivalent to another StateTime.

Specified by:
equals in interface TimelineTime
Overrides:
equals in class java.lang.Object

greaterThan

public boolean greaterThan(StateTime other)
                    throws Scheherexception
Determines if this StateTime is greater than another StateTime.

Throws:
Scheherexception

render

public java.lang.StringBuffer render()
Serialize the StateTime.

Specified by:
render in interface RenderableObject
Specified by:
render in interface TimelineTime

compareTo

public int compareTo(StateTime other)
Compares two StateTimes in a way consistent with other CompareTo functions in Java


compareTo

public int compareTo(java.lang.Object other)
              throws java.lang.ClassCastException
Specified by:
compareTo in interface java.lang.Comparable
Throws:
java.lang.ClassCastException

hasTimeIndex

public boolean hasTimeIndex()
Returns whether this StateTime has a time index (i.e., is not Virtual or Unbounded)


getTimeIndex

public double getTimeIndex()
                    throws Scheherexception
Returns the time index of the StateTime.

Throws:
Scheherexception

getTimeType

public StateTimeType getTimeType()
Returns the StateTimeType of the StateTime.


renderForHumans

public java.lang.StringBuffer renderForHumans()
Render the StateTime in a way that is not reinterpretable by the StateTime(String) constructor, but is nicer for humans to read.

Specified by:
renderForHumans in interface TimelineTime


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