Class FileDatabase

  • All Implemented Interfaces:
    Database

    public class FileDatabase
    extends Object
    implements Database
    Implementation of Database, that stores all data into specified file.
    Since:
    0.1.0
    Author:
    michalt
    • Constructor Detail

      • FileDatabase

        public FileDatabase​(String filePath)
                     throws IOException
        Instantiates a new file database.
        Parameters:
        filePath - the file path
        Throws:
        IOException - Signals that an I/O exception has occurred.
    • Method Detail

      • createOrOpen

        public <T> DbConcurrentMap<T> createOrOpen​(String tableName,
                                                   Class<T> clazz)
        Description copied from interface: Database
        Creates the or open table of defined tableName.
        Specified by:
        createOrOpen in interface Database
        Type Parameters:
        T - the generic type
        Parameters:
        tableName - the table name
        clazz - the clazz
        Returns:
        the db concurrent map
      • drop

        public void drop​(String tableName)
        Description copied from interface: Database
        Drops table with defined tableName.
        Specified by:
        drop in interface Database
        Parameters:
        tableName - the table name