story.scheherazade.elements
Class Condition

java.lang.Object
  extended by story.scheherazade.elements.Condition
All Implemented Interfaces:
CloneableObject, RenderableObject, Predicate
Direct Known Subclasses:
ValidCondition

public class Condition
extends java.lang.Object
implements RenderableObject, Predicate, CloneableObject

A Condition is a property that can be associated with a character at a state in time. This is a "concrete," or instantiated Condition, which means that it is associated with whatever properties are needed for instantiation, but not inherently assigned to a particular state or character. For example, this is not "the property of feeling" or "John felt happy," but "feeling happy."

In order to construct a Condition the type of condition must have already been "declared" in Timeline.


Constructor Summary
Condition(ConditionType conditionType, SCHArguments arguments, int truthDegree, PredicateMode mode)
           
 
Method Summary
 boolean equals(Condition other)
          Determines if this Condition is equivalent to some other.
 PredicateMode getMode()
          Get the mode of the condition.
 PredicateFlavor getPredicateFlavor()
           
 SCHArguments getSCHArguments()
          Get the arguments used to instantiate this Condition
 int getTruthDegree()
          Get the degree of this condition's truth in effect.
 ConditionType getType()
           
 Condition makeClone()
           
 java.lang.StringBuffer render()
           
static java.lang.StringBuffer render(ConditionType conditionType, SCHArguments arguments, int truthDegree, PredicateMode mode)
          A static function that renders a ConditionType and arguments as they would be rendered if they were part of a Condition.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Condition

public Condition(ConditionType conditionType,
                 SCHArguments arguments,
                 int truthDegree,
                 PredicateMode mode)
          throws Scheherexception
Throws:
Scheherexception
Method Detail

getType

public ConditionType getType()

getSCHArguments

public SCHArguments getSCHArguments()
                             throws Scheherexception
Get the arguments used to instantiate this Condition

Throws:
Scheherexception

getTruthDegree

public int getTruthDegree()
Get the degree of this condition's truth in effect.


getMode

public PredicateMode getMode()
Get the mode of the condition.


render

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

render

public static java.lang.StringBuffer render(ConditionType conditionType,
                                            SCHArguments arguments,
                                            int truthDegree,
                                            PredicateMode mode)
                                     throws Scheherexception
A static function that renders a ConditionType and arguments as they would be rendered if they were part of a Condition. Does not validate to make sure such a Condition would be legal.

Throws:
Scheherexception

equals

public boolean equals(Condition other)
               throws Scheherexception
Determines if this Condition is equivalent to some other.

Throws:
Scheherexception

getPredicateFlavor

public PredicateFlavor getPredicateFlavor()
Specified by:
getPredicateFlavor in interface Predicate

makeClone

public Condition makeClone()
                    throws Scheherexception
Specified by:
makeClone in interface CloneableObject
Throws:
Scheherexception


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