Class TrackedDatabase

  • All Implemented Interfaces:
    IndexDatabase

    public class TrackedDatabase
    extends java.lang.Object
    implements IndexDatabase
    Class TrackedDatabase defines an IndexDatabase created from a list of files. Each files is parsed using an FileParser and then registered in the Database. SerializedIO can then be used to save the current state of the database into a unique binary file and therefore prevent the parsing of every file every time we launch the program. Each tracked file is automatically compared to the file present in the database and if any difference is noticed the file is parsed again.

    Example of usage:
         DBTable table = new DBTable.Builder()
                     .registerArgument("arg1")
                     .registerArgument("arg2")
                     .registerIndexedArguments("name")
                     .registerIndexedArguments("index")
                     .create();
          TrackedDatabase db = new TrackedDatabase.Builder().setIO(io)
                                       .setParser(parser)
                                       .setTable(table)
                                       .setTrackedDirectory("../path/to/tracked/directory")
                                       .create();
          db.sync();
     
    For further information about the query see IndexDatabase
    • Method Summary

      Modifier and Type Method Description
      java.util.List<DBEntry> query​(IndexQuery query)  
      void sync()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait