## org.exist.storage.btree
Class Paged.FileHeader

    java.lang.Object
      org.exist.storage.btree.Paged.FileHeader

Enclosing class:
  Paged

public abstract class Paged.FileHeader
extends java.lang.Object

FileHeader

Author:
  Wolfgang Meier <meier@ifs.tu-darmstadt.de>

Constructor Summary
`Paged.FileHeader()` Constructor for the FileHeader object
`Paged.FileHeader(boolean read)`
`Paged.FileHeader(long pageCount)` Constructor for the FileHeader object
`Paged.FileHeader(long pageCount, int pageSize)`
`Paged.FileHeader(long pageCount, int pageSize, byte blockSize)`

Method Summary
`void` `decRecordCount()` Decrement the number of records being managed by the file
`long` `getFirstFreePage()` The first free page in unused secondary space
`short` `getHeaderSize()` The size of the FileHeader.
`long` `getLastFreePage()` The last free page in unused secondary space
`short` `getMaxKeySize()` The maximum number of bytes a key can be.
`long` `getPageCount()` The number of pages in primary storage
`byte` `getPageHeaderSize()` The size of a page header.
`int` `getPageSize()` The size of a page.
`long` `getRecordCount()` The number of records being managed by the file (not pages)
`long` `getTotalCount()` The number of total pages in the file
`short` `getVersion()`
`int` `getWorkSize()` Gets the workSize attribute of the FileHeader object
`void` `incRecordCount()` Increment the number of records being managed by the file
`boolean` `isDirty()` Returns whether this page has been modified or not.
`void` `read()`
`int` `read(byte[] buf)`
`void` `setDirty(boolean dirty)` Sets the dirty attribute of the FileHeader object
`void` `setFirstFreePage(long firstFreePage)` The first free page in unused secondary space
`void` `setHeaderSize(short headerSize)` The size of the FileHeader.
`void` `setLastFreePage(long lastFreePage)` The last free page in unused secondary space
`void` `setMaxKeySize(short maxKeySize)` The maximum number of bytes a key can be.
`void` `setPageCount(long pageCount)` The number of pages in primary storage
`void` `setPageHeaderSize(byte pageHeaderSize)` The size of a page header.
`void` `setPageSize(int pageSize)` The size of a page.
`void` `setRecordCount(long recordCount)` The number of records being managed by the file (not pages)
`void` `setTotalCount(long totalCount)` The number of total pages in the file
`void` `write()`
`int` `write(byte[] buf)`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Paged.FileHeader

    public Paged.FileHeader()

  Constructor for the FileHeader object

### Paged.FileHeader

    public Paged.FileHeader(long pageCount)

  Constructor for the FileHeader object

Parameters:
  `pageCount` - Description of the Parameter

### Paged.FileHeader

    public Paged.FileHeader(long pageCount,
                            int pageSize)

### Paged.FileHeader

    public Paged.FileHeader(long pageCount,
                            int pageSize,
                            byte blockSize)

### Paged.FileHeader

    public Paged.FileHeader(boolean read)
                     throws java.io.IOException

Method Detail

### decRecordCount

    public final void decRecordCount()

  Decrement the number of records being managed by the file

### getFirstFreePage

    public final long getFirstFreePage()

  The first free page in unused secondary space

  Returns:
    The firstFreePage value

### getHeaderSize

    public final short getHeaderSize()

  The size of the FileHeader. Usually 1 OS Page

  Returns:
    The headerSize value

### getLastFreePage

    public final long getLastFreePage()

  The last free page in unused secondary space

  Returns:
    The lastFreePage value

### getMaxKeySize

    public final short getMaxKeySize()

  The maximum number of bytes a key can be. 256 is good

  Returns:
    The maxKeySize value

### getPageCount

    public final long getPageCount()

  The number of pages in primary storage

  Returns:
    The pageCount value

### getPageHeaderSize

    public final byte getPageHeaderSize()

  The size of a page header. 64 is sufficient

  Returns:
    The pageHeaderSize value

### getPageSize

    public final int getPageSize()

  The size of a page. Usually a multiple of a FS block

  Returns:
    The pageSize value

### getRecordCount

    public final long getRecordCount()

  The number of records being managed by the file (not pages)

  Returns:
    The recordCount value

### getTotalCount

    public final long getTotalCount()

  The number of total pages in the file

  Returns:
    The totalCount value

### getWorkSize

    public final int getWorkSize()

  Gets the workSize attribute of the FileHeader object

  Returns:
    The workSize value

### getVersion

    public final short getVersion()

### incRecordCount

    public final void incRecordCount()

  Increment the number of records being managed by the file

### isDirty

    public final boolean isDirty()

  Returns whether this page has been modified or not.

  Returns:
    `true` if this page has been modified

### read

    public final void read()
                    throws java.io.IOException

  Throws:
    `java.io.IOException`

### read

    public int read(byte[] buf)
             throws java.io.IOException

  Throws:
    `java.io.IOException`

### setDirty

    public final void setDirty(boolean dirty)

  Sets the dirty attribute of the FileHeader object

  Parameters:
    `dirty` - The new dirty value

### setFirstFreePage

    public final void setFirstFreePage(long firstFreePage)

  The first free page in unused secondary space

  Parameters:
    `firstFreePage` - The new firstFreePage value

### setHeaderSize

    public final void setHeaderSize(short headerSize)

  The size of the FileHeader. Usually 1 OS Page

  Parameters:
    `headerSize` - The new headerSize value

### setLastFreePage

    public final void setLastFreePage(long lastFreePage)

  The last free page in unused secondary space

  Parameters:
    `lastFreePage` - The new lastFreePage value

### setMaxKeySize

    public final void setMaxKeySize(short maxKeySize)

  The maximum number of bytes a key can be. 256 is good

  Parameters:
    `maxKeySize` - The new maxKeySize value

### setPageCount

    public final void setPageCount(long pageCount)

  The number of pages in primary storage

  Parameters:
    `pageCount` - The new pageCount value

### setPageHeaderSize

    public final void setPageHeaderSize(byte pageHeaderSize)

  The size of a page header. 64 is sufficient

  Parameters:
    `pageHeaderSize` - The new pageHeaderSize value

### setPageSize

    public final void setPageSize(int pageSize)

  The size of a page. Usually a multiple of a FS block

  Parameters:
    `pageSize` - The new pageSize value

### setRecordCount

    public final void setRecordCount(long recordCount)

  The number of records being managed by the file (not pages)

  Parameters:
    `recordCount` - The new recordCount value

### setTotalCount

    public final void setTotalCount(long totalCount)

  The number of total pages in the file

  Parameters:
    `totalCount` - The new totalCount value

### write

    public final void write()
                     throws java.io.IOException

  Throws:
    `java.io.IOException`

### write

    public int write(byte[] buf)
              throws java.io.IOException

  Throws:
    `java.io.IOException`

Copyright (C) Wolfgang Meier. All rights reserved.