Class TableDescriptions

java.lang.Object
com.mckoi.database.TableDescriptions

public final class TableDescriptions extends Object
An object that is a key part of Database. This object maintains a list of descriptions of all tables in the database. The list contains information about the columns in the table and any other misc table options.
Author:
Tobias Downer
  • Constructor Summary

    Constructors
    Constructor
    Description
    TableDescriptions(File database_path)
    Constructs this object with the database in the given directory.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns true if the table descriptions file exists.
    getDef(String table_name)
    Returns the DataTableDef object for the table with the given name.
    Returns a list of table name's sorted in alphebetical order.
    void
    Load the entire list of table descriptions for this database.
    void
    Updates the table description file in the database.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TableDescriptions

      public TableDescriptions(File database_path)
      Constructs this object with the database in the given directory.
  • Method Details

    • exists

      public boolean exists()
      Returns true if the table descriptions file exists.
    • load

      public void load() throws IOException
      Load the entire list of table descriptions for this database.
      Throws:
      IOException
    • save

      public void save() throws IOException
      Updates the table description file in the database. The table description file describes every table in the database. It is loaded when the database is initialized and refreshed whenever a table alteration occurs or the database is shut down.
      Throws:
      IOException
    • getTableList

      public String[] getTableList()
      Returns a list of table name's sorted in alphebetical order.
    • getDef

      public DataTableDef getDef(String table_name)
      Returns the DataTableDef object for the table with the given name. The description must have been loaded before this method is called. Returns null if the table was not found.