dbXML API

## com.dbxml.db.common.btree
Class BTreeFiler

    java.lang.Object
      com.dbxml.db.common.btree.Paged
          com.dbxml.db.common.btree.BTree
              com.dbxml.db.common.btree.BTreeFiler

All Implemented Interfaces:
  Configurable, Filer

public final class BTreeFiler
extends BTree
implements Filer

BTreeFiler is a Filer implementation based on the BTree class.

Nested Class Summary

Nested classes inherited from class com.dbxml.db.common.btree.Paged
`Paged.FileHeader, Paged.Page, Paged.PageHeader`

Constructor Summary
`BTreeFiler()`
`BTreeFiler(boolean transactionSupported)`
`BTreeFiler(java.io.File f)`
`BTreeFiler(java.io.File f, boolean transactionSupport)`

Method Summary
`boolean` `create()` create creates a new Filer and any associated resources for the new Filer, such as disk files, etc.
`Paged.FileHeader` `createFileHeader()` createFileHeader must be implemented by a Paged implementation in order to create an appropriate subclass instance of a FileHeader.
`Paged.FileHeader` `createFileHeader(boolean read)` createFileHeader must be implemented by a Paged implementation in order to create an appropriate subclass instance of a FileHeader.
`Paged.FileHeader` `createFileHeader(long pageCount)` createFileHeader must be implemented by a Paged implementation in order to create an appropriate subclass instance of a FileHeader.
`Paged.FileHeader` `createFileHeader(long pageCount, int pageSize)` createFileHeader must be implemented by a Paged implementation in order to create an appropriate subclass instance of a FileHeader.
`Paged.PageHeader` `createPageHeader()` createPageHeader must be implemented by a Paged implementation in order to create an appropriate subclass instance of a PageHeader.
`boolean` `deleteRecord(Transaction tx, Key key)` deleteRecord removes a Record from the Filer based on the specified Key.
`java.lang.String` `getName()` getName returns the name of this Filer.
`long` `getRecordCount(Transaction tx)` getRecordCount returns the number of Records in the Filer.
`RecordMetaData` `getRecordMetaData(Transaction tx, Key key)` getRecordMetaData returns metadata about the Record identified by the provided Key.
`RecordSet` `getRecordSet(Transaction tx)` getRecordSet returns a RecordSet object for the current Filer.
`Record` `readRecord(Transaction tx, Key key)` readRecord returns a Record from the Filer based on the specified Key.
`void` `setCollection(Collection collection)` setCollection tells the Filer who its parent is.
`void` `setLocation(java.lang.String location)`
`boolean` `writeRecord(Transaction tx, Key key, Value value)` writeRecord writes a Value to the Filer based on the specified Key.

Methods inherited from class com.dbxml.db.common.btree.BTree
`addValue, findValue, open, query, removeValue`

Methods inherited from class com.dbxml.db.common.btree.Paged
`addPageFilter, close, deleteArrayValue, drop, exists, flush, getConfig, getFileHeader, getTransactionLog, insertArrayValue, isOpened, listPageFilters, removePageFilter, setConfig`

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

Methods inherited from interface com.dbxml.db.core.filer.Filer
`close, drop, exists, flush, getTransactionLog, isOpened, open`

Methods inherited from interface com.dbxml.util.Configurable
`getConfig, setConfig`

Constructor Detail

### BTreeFiler

    public BTreeFiler(boolean transactionSupported)

### BTreeFiler

    public BTreeFiler(java.io.File f,
                      boolean transactionSupport)

### BTreeFiler

    public BTreeFiler(java.io.File f)

### BTreeFiler

    public BTreeFiler()

Method Detail

### setLocation

    public void setLocation(java.lang.String location)

### getName

    public java.lang.String getName()

  Description copied from interface: `Filer`
  getName returns the name of this Filer.

  Specified by:
    `getName` in interface `Filer`
  Returns:
    the Filer name

### create

    public boolean create()
                   throws DBException

  Description copied from interface: `Filer`
  create creates a new Filer and any associated resources for the new Filer, such as disk files, etc.

  Specified by:
    `create` in interface `Filer`
  Overrides:
    `create` in class `BTree`
  Throws:
    `DBException`

### setCollection

    public void setCollection(Collection collection)

  Description copied from interface: `Filer`
  setCollection tells the Filer who its parent is.

  Specified by:
    `setCollection` in interface `Filer`
  Parameters:
    `collection` - The owner Collection

### getRecordMetaData

    public RecordMetaData getRecordMetaData(Transaction tx,
                                            Key key)
                                     throws DBException

  Description copied from interface: `Filer`
  getRecordMetaData returns metadata about the Record identified by the provided Key. This method should make every attempt to not read the actual record from its original location.

  Specified by:
    `getRecordMetaData` in interface `Filer`
  Parameters:
    `tx` - The controlling Transaction
    `key` - The Record's Key
  Returns:
    The Record's metadata
  Throws:
    `DBException`

### readRecord

    public Record readRecord(Transaction tx,
                             Key key)
                      throws DBException

  Description copied from interface: `Filer`
  readRecord returns a Record from the Filer based on the specified Key.

  Specified by:
    `readRecord` in interface `Filer`
  Parameters:
    `tx` - The controlling Transaction
    `key` - The Record's Key
  Returns:
    The returned Record
  Throws:
    `DBException`

### writeRecord

    public boolean writeRecord(Transaction tx,
                               Key key,
                               Value value)
                        throws DBException

  Description copied from interface: `Filer`
  writeRecord writes a Value to the Filer based on the specified Key.

  Specified by:
    `writeRecord` in interface `Filer`
  Parameters:
    `tx` - The controlling Transaction
    `key` - The Record's Key
    `value` - The Record's Value
  Returns:
    Whether or not the Record could be written
  Throws:
    `DBException`

### deleteRecord

    public boolean deleteRecord(Transaction tx,
                                Key key)
                         throws DBException

  Description copied from interface: `Filer`
  deleteRecord removes a Record from the Filer based on the specified Key.

  Specified by:
    `deleteRecord` in interface `Filer`
  Parameters:
    `tx` - The controlling Transaction
    `key` - The Record's Key
  Returns:
    Whether or not the Record was deleted
  Throws:
    `DBException`

### getRecordCount

    public long getRecordCount(Transaction tx)
                        throws DBException

  Description copied from interface: `Filer`
  getRecordCount returns the number of Records in the Filer.

  Specified by:
    `getRecordCount` in interface `Filer`
  Parameters:
    `tx` - The controlling Transaction
  Returns:
    The Record count
  Throws:
    `DBException`

### getRecordSet

    public RecordSet getRecordSet(Transaction tx)
                           throws DBException

  Description copied from interface: `Filer`
  getRecordSet returns a RecordSet object for the current Filer.

  Specified by:
    `getRecordSet` in interface `Filer`
  Parameters:
    `tx` - The controlling Transaction
  Returns:
    The Filer Enumerator
  Throws:
    `DBException`

### createFileHeader

    public Paged.FileHeader createFileHeader()

  Description copied from class: `Paged`
  createFileHeader must be implemented by a Paged implementation in order to create an appropriate subclass instance of a FileHeader.

  Overrides:
    `createFileHeader` in class `BTree`

### createFileHeader

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

  Description copied from class: `Paged`
  createFileHeader must be implemented by a Paged implementation in order to create an appropriate subclass instance of a FileHeader.

  Overrides:
    `createFileHeader` in class `BTree`
  Throws:
    `java.io.IOException`

### createFileHeader

    public Paged.FileHeader createFileHeader(long pageCount)

  Description copied from class: `Paged`
  createFileHeader must be implemented by a Paged implementation in order to create an appropriate subclass instance of a FileHeader.

  Overrides:
    `createFileHeader` in class `BTree`

### createFileHeader

    public Paged.FileHeader createFileHeader(long pageCount,
                                             int pageSize)

  Description copied from class: `Paged`
  createFileHeader must be implemented by a Paged implementation in order to create an appropriate subclass instance of a FileHeader.

  Overrides:
    `createFileHeader` in class `BTree`

### createPageHeader

    public Paged.PageHeader createPageHeader()

  Description copied from class: `Paged`
  createPageHeader must be implemented by a Paged implementation in order to create an appropriate subclass instance of a PageHeader.

  Overrides:
    `createPageHeader` in class `BTree`

dbXML API

Copyright (c) 2004 The dbXML Group