Enum DBFileType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<DBFileType>

    public enum DBFileType
    extends java.lang.Enum<DBFileType>
    This enumeration specifies the different types of data file that the database knows about. Each file type is assigned a unique integer value in the range [0, 255], which is stored as the very first byte of data files of that type. This way, it's straightforward to determine a file's type by examination.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      BTREE_TUPLE_FILE
      Represents a B+ tree tuple file that keeps tuples in a particular sequential order.
      HEAP_TUPLE_FILE
      Represents a heap tuple file, which supports variable-size tuples and stores them in no particular order.
      TEST_FILE
      Represents a file used during testing.
      TXNSTATE_FILE
      Represents a transaction-state file used for write-ahead logging and recovery.
      WRITE_AHEAD_LOG_FILE
      Represents a write-ahead log file used for transaction processing and recovery.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int id
      A numeric ID that uniquely identifies this database file type.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private DBFileType​(int id)
      Initialize a DBFileType enum with the specified ID value.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getID()
      Returns the numeric ID of this DBFileType enum.
      static DBFileType valueOf​(int id)
      Given a numeric type ID, returns the corresponding type value for the ID, or null if no type corresponds to the ID.
      static DBFileType valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static DBFileType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • HEAP_TUPLE_FILE

        public static final DBFileType HEAP_TUPLE_FILE
        Represents a heap tuple file, which supports variable-size tuples and stores them in no particular order.
      • BTREE_TUPLE_FILE

        public static final DBFileType BTREE_TUPLE_FILE
        Represents a B+ tree tuple file that keeps tuples in a particular sequential order.
      • TXNSTATE_FILE

        public static final DBFileType TXNSTATE_FILE
        Represents a transaction-state file used for write-ahead logging and recovery.
      • WRITE_AHEAD_LOG_FILE

        public static final DBFileType WRITE_AHEAD_LOG_FILE
        Represents a write-ahead log file used for transaction processing and recovery.
      • TEST_FILE

        public static final DBFileType TEST_FILE
        Represents a file used during testing.
    • Field Detail

      • id

        private int id
        A numeric ID that uniquely identifies this database file type.
    • Constructor Detail

      • DBFileType

        private DBFileType​(int id)
        Initialize a DBFileType enum with the specified ID value.
    • Method Detail

      • values

        public static DBFileType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (DBFileType c : DBFileType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static DBFileType valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getID

        public int getID()
        Returns the numeric ID of this DBFileType enum.
      • valueOf

        public static DBFileType valueOf​(int id)
        Given a numeric type ID, returns the corresponding type value for the ID, or null if no type corresponds to the ID.
        Parameters:
        id - the numeric ID of the type to retrieve
        Returns:
        the type-value with that ID, or null if not found