story.dbcore.attributes
Class Attribute

java.lang.Object
  extended by story.dbcore.attributes.Attribute
Direct Known Subclasses:
ActionTypeAttribute, BooleanAttribute, ConditionTypeAttribute, DoubleAttribute, EnumAttribute, FloatAttribute, IntegerAttribute, LongAttribute, ModifiablePredicatesAttribute, ModifierTypeAttribute, NarrativeIDAttribute, NodeAddressAttribute, NodeInstancingAttribute, NounNameAttribute, NounTypeAttribute, ParameterSetAttribute, PointAttribute, SCHArgumentsAttribute, StateTimeAttribute, StoryAssertionAttribute, TextField, TextSpanAttribute, TimelineIDAttribute, TimelineTimeAttribute, TypeAttribute, ValidActionAttribute, ValidConditionAttribute, ValidModifierAttribute, ValidNounAttribute

public abstract class Attribute
extends java.lang.Object

Root abstract class for an Attribute. It is an interface in spirit, but implemented as an abstract class so it can factor out a little bit of common functionality.

Any class that extends and concretizes this class can be used as an attribute in the db-core. The db-core has a set of attribute types to start with (such as TextField) but the system is designed this way so that calling applications can "plug in" their own custom attribute types. Scheherazade and Flashback will each have such custom attribute types.


Method Summary
abstract  boolean equals(AttributeValue constant)
          All extending classes must implement an equals(AttributeValue) function that determines whether this attribute holds an equivalent value to an argued string constant.
abstract  boolean greaterThan(AttributeValue constant)
          All extending classes must implement a greaterThan(AttributeValue) function that determines whether this attribute holds a value greater than an argued string constant.
abstract  int maxLength()
          All extending classes must report their maximum length.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

equals

public abstract boolean equals(AttributeValue constant)
                        throws Scheherexception
All extending classes must implement an equals(AttributeValue) function that determines whether this attribute holds an equivalent value to an argued string constant. They should throw an exception if the attribute type can't be compared to the value of the string.

If you are writing an Attribute class, be sure to check for a null AttributeValue value here.

Throws:
Scheherexception

greaterThan

public abstract boolean greaterThan(AttributeValue constant)
                             throws Scheherexception
All extending classes must implement a greaterThan(AttributeValue) function that determines whether this attribute holds a value greater than an argued string constant. They should throw an exception if the attribute type can't be compared to the value of the string.

If you are writing an Attribute class, be sure to check for a null AttributeValue value here.

Throws:
Scheherexception

maxLength

public abstract int maxLength()
                       throws Scheherexception
All extending classes must report their maximum length.

Throws:
Scheherexception


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