Class Db

java.lang.Object
  extended by com.sri.oaa2.icl.IclDb
      extended by Db

public class Db
extends com.sri.oaa2.icl.IclDb

An IclDb, used to store IclTerms. These will be used to build calendar files - VCalendar format. (for iCal and K-Organizer) The Db is made as a Singleton object. That is, there can be only one Db at any one time.


Field Summary
static boolean clear
           
 
Method Summary
 boolean delete(int idNo)
          Deleting an object in the IclDb with a specific ID number.
 int getId()
          Getting the next ID number in order to use it to identify the objects.
static Db getInstance()
          Getting the only instance of the DB
 int getLastId(com.sri.oaa2.icl.IclList l)
          Method for getting the latest/highest ID number that is used in the IclDb.
 java.io.File getSave()
          Getting the binary file where the calendar information is stored.
 void setDb(com.sri.oaa2.icl.IclDb db)
          Setting the Db to an new IclDb.
 void setId(int i)
           
 
Methods inherited from class com.sri.oaa2.icl.IclDb
asserta, assertz, db_Assert, db_Contains, db_getRef, db_PrintDB, db_Replace, db_Retract, db_Retract, db_Solve, db_Solve, db_SolveDebug, erase, replace_all, retract_all, retract, retract, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

clear

public static boolean clear
Method Detail

getInstance

public static Db getInstance()
Getting the only instance of the DB

Returns:
the only instance of an IclDb

getSave

public java.io.File getSave()
Getting the binary file where the calendar information is stored.

Returns:
the binary file containg calendar information

getId

public int getId()
Getting the next ID number in order to use it to identify the objects. It is use to simplify the delete method.

Returns:
the next number to be used

setId

public void setId(int i)

delete

public boolean delete(int idNo)
Deleting an object in the IclDb with a specific ID number.

Parameters:
idNo - the ID number of the object to delete
Returns:
true if deleted, otherwise false

getLastId

public int getLastId(com.sri.oaa2.icl.IclList l)
Method for getting the latest/highest ID number that is used in the IclDb. Even if a sequence of ID's is broken, the highest number is returned.

Parameters:
l - an IclList with all IclTerms in the IclDb
Returns:
the highest ID number that is used

setDb

public void setDb(com.sri.oaa2.icl.IclDb db)
Setting the Db to an new IclDb.

Parameters:
db - the new IclDb