net.sourceforge.pain.db
Interface DbClass


public interface DbClass

Persistent Class for DbObject


Method Summary
 void delete()
          removes all objects for this class and dbClass itself
 java.util.Iterator extentIterator()
          equal to extentIterator(false)
 java.util.Iterator extentIterator(boolean weak)
           
 java.lang.String getClassName()
           
 PainDB getDB()
           
 java.lang.String getFieldName(int n)
           
 byte getFieldType(int n)
           
 int getNumberOfFields()
           
 int getNumberOfObjects()
           
 java.io.Serializable getOid()
           
 int pain_getIndexId()
          this is optimization method specially produced for PAiN Mud Codebase for performance purpose It use knowledge that index id for the class stays the same whole DbClass instance lifetime (But it couldbe reused after class removal)
 

Method Detail

getDB

public PainDB getDB()

getNumberOfFields

public int getNumberOfFields()

getClassName

public java.lang.String getClassName()

getFieldName

public java.lang.String getFieldName(int n)
Parameters:
n - number of field
Returns:
field name

getFieldType

public byte getFieldType(int n)
Parameters:
n - number of field
Returns:
field type class constants

extentIterator

public java.util.Iterator extentIterator(boolean weak)
Parameters:
weak - ignores class extent modifications (new objects creation, object removal) during iteration if 'weak' is true. 'weak'==true will lead to ConcurredModificationExcepiton if class extend is changing during iteration Weak iterator will see all new objects created during it's traversal WARN: weakIterator could throw IllegalStateException if the 'next' object was removed between 'hasNext' and 'next' method call and there is no more objects to iterate (should call these methods locally in code)
Returns:
Iterator instance to iterate all objects (not deleted) of this class in database

extentIterator

public java.util.Iterator extentIterator()
equal to extentIterator(false)


getNumberOfObjects

public int getNumberOfObjects()
Returns:
number of objects for this DbClass in Database (without objects in deleted state)

delete

public void delete()
removes all objects for this class and dbClass itself


getOid

public java.io.Serializable getOid()
Returns:
serializable class id.

pain_getIndexId

public int pain_getIndexId()
this is optimization method specially produced for PAiN Mud Codebase for performance purpose It use knowledge that index id for the class stays the same whole DbClass instance lifetime (But it couldbe reused after class removal)