net.sourceforge.pain.data
Class AffectData

java.lang.Object
  extended bynet.sourceforge.pain.db.DbObject
      extended bynet.sourceforge.pain.data.AffectData
Direct Known Subclasses:
TimedAffectData

public class AffectData
extends DbObject

Affects persistent image base class Note: Only one affect could be applied to the specified object role(in opposite to object triggers) Affected role could be null.

All subclasses of AffectData and TimedAffectData are DbObjects and should add only new fields to save All subclasses should be defined in data.affects package and should not contain any logical code.


Field Summary
protected static int LAST_BASE_FIELD_INDEX
          used by subclasses
 
Constructor Summary
AffectData()
           
AffectData(PainDB db, Role role, java.lang.Class affectImplClass, int affectTypeId)
           
 
Method Summary
protected  void fillSuperSchema(byte[] types, java.lang.String[] names)
           
 java.lang.String getAffectClassName()
          suffix of affect class name in "...logic.affect." package
 Role getAffectedRole()
          affected role is allowed to be null
 int getAffectOffTime()
           
 int getAffectType()
           
protected  DbClassSchema provideSchema()
          Every time we add new DbObject of the unknown class to database this method is called.
 
Methods inherited from class net.sourceforge.pain.db.DbObject
delete, getArrayList, getBoolean, getByte, getByteArray, getByteArrayForRead, getChar, getCharArray, getCharArrayForRead, getDB, getDbClass, getDouble, getFloat, getInt, getIntArray, getIntArrayForRead, getIntKeyMap, getLinkedList, getList, getLong, getOid, getReference, getRefSet, getShort, getString, getStringArray, getStringArrayForRead, getStringKeyMap, getStringMap, getStringSet, isClean, isDeleted, isDetached, isDirty, isNew, setBoolean, setByte, setByteArray, setChar, setCharArray, setDouble, setFloat, setInt, setIntArray, setLong, setReference, setShort, setString, setStringArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LAST_BASE_FIELD_INDEX

protected static int LAST_BASE_FIELD_INDEX
used by subclasses

Constructor Detail

AffectData

public AffectData()

AffectData

public AffectData(PainDB db,
                  Role role,
                  java.lang.Class affectImplClass,
                  int affectTypeId)
           throws java.lang.Exception
Parameters:
db -
role - - affected role
affectImplClass -
Throws:
java.lang.Exception
Method Detail

provideSchema

protected DbClassSchema provideSchema()
Description copied from class: DbObject
Every time we add new DbObject of the unknown class to database this method is called. DbClass instance will be automatically created. It's called only once for every new class.

Specified by:
provideSchema in class DbObject

fillSuperSchema

protected void fillSuperSchema(byte[] types,
                               java.lang.String[] names)

getAffectType

public final int getAffectType()

getAffectedRole

public Role getAffectedRole()
affected role is allowed to be null


getAffectClassName

public java.lang.String getAffectClassName()
suffix of affect class name in "...logic.affect." package


getAffectOffTime

public int getAffectOffTime()