dbXML API

org.dbxml.core.filer
Class BTreeFiler

java.lang.Object
  |
  +--org.dbxml.core.filer.Paged
        |
        +--org.dbxml.core.filer.BTree
              |
              +--org.dbxml.core.filer.BTreeFiler
All Implemented Interfaces:
org.dbxml.server.Configurable, DBObject, Filer, org.dbxml.server.Named

public final class BTreeFiler
extends BTree
implements org.dbxml.server.Configurable, Filer

BTreeFiler is a Filer implementation based on the BTree class.


Inner classes inherited from class org.dbxml.core.filer.BTree
BTree.BTreeRootInfo
 
Inner classes inherited from class org.dbxml.core.filer.Paged
Paged.FileHeader, Paged.Page, Paged.PageHeader
 
Constructor Summary
BTreeFiler()
           
 
Method Summary
 boolean create()
          create creates a new DBObject and any associated resources for the new DBObject, 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(Key key)
          deleteRecord removes a Record from the Filer based on the specified Key.
 org.dbxml.server.Configuration getConfig()
           
 java.lang.String getName()
           
 long getRecordCount()
          getRecordCount returns the number of Records in the Filer.
 RecordSet getRecordSet()
          getRecordSet returns a RecordSet object for the current Filer.
 boolean open()
          open opens the DBObject
 Record readRecord(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 setConfig(org.dbxml.server.Configuration config)
           
 void setLocation(java.lang.String location)
           
 boolean writeRecord(Key key, Value value)
          writeRecord writes a Value to the Filer based on the specified Key.
 
Methods inherited from class org.dbxml.core.filer.BTree
addValue, addValue, findValue, findValue, query, query, removeValue, removeValue
 
Methods inherited from class org.dbxml.core.filer.Paged
close, deleteArrayInt, deleteArrayLong, deleteArrayShort, deleteArrayValue, drop, exists, getFileHeader, insertArrayInt, insertArrayLong, insertArrayShort, insertArrayValue, isOpened
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.dbxml.core.DBObject
close, drop, exists, isOpened
 

Constructor Detail

BTreeFiler

public BTreeFiler()
Method Detail

setConfig

public void setConfig(org.dbxml.server.Configuration config)
Specified by:
setConfig in interface org.dbxml.server.Configurable

getConfig

public org.dbxml.server.Configuration getConfig()
Specified by:
getConfig in interface org.dbxml.server.Configurable

setLocation

public void setLocation(java.lang.String location)

getName

public java.lang.String getName()
Specified by:
getName in interface org.dbxml.server.Named

open

public boolean open()
             throws DBException
Description copied from interface: DBObject
open opens the DBObject
Specified by:
open in interface DBObject
Overrides:
open in class BTree
Following copied from interface: org.dbxml.core.DBObject
Returns:
Whether or not the DBObject was opened

create

public boolean create()
               throws DBException
Description copied from interface: DBObject
create creates a new DBObject and any associated resources for the new DBObject, such as disk files, etc.
Specified by:
create in interface DBObject
Overrides:
create in class BTree
Following copied from interface: org.dbxml.core.DBObject
Returns:
Whether or not the DBObject was created

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
Following copied from interface: org.dbxml.core.filer.Filer
Parameters:
collection - The owner Collection

readRecord

public Record readRecord(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
Following copied from interface: org.dbxml.core.filer.Filer
Parameters:
key - The Record's Key
Returns:
The returned Record

writeRecord

public boolean writeRecord(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
Following copied from interface: org.dbxml.core.filer.Filer
Parameters:
key - The Record's Key
value - The Record's Value
Returns:
Whether or not the Record could be written

deleteRecord

public boolean deleteRecord(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
Following copied from interface: org.dbxml.core.filer.Filer
Parameters:
key - The Record's Key
Returns:
Whether or not the Record was deleted

getRecordCount

public long getRecordCount()
                    throws DBException
Description copied from interface: Filer
getRecordCount returns the number of Records in the Filer.
Specified by:
getRecordCount in interface Filer
Following copied from interface: org.dbxml.core.filer.Filer
Returns:
The Record count

getRecordSet

public RecordSet getRecordSet()
                       throws DBException
Description copied from interface: Filer
getRecordSet returns a RecordSet object for the current Filer.
Specified by:
getRecordSet in interface Filer
Following copied from interface: org.dbxml.core.filer.Filer
Returns:
The Filer Enumerator

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
Following copied from class: org.dbxml.core.filer.Paged
Returns:
a new FileHeader

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
Following copied from class: org.dbxml.core.filer.Paged
Parameters:
read - If true, reads the FileHeader from disk
Returns:
a new FileHeader
Throws:
java.io.IOException - if an exception occurs

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
Following copied from class: org.dbxml.core.filer.Paged
Parameters:
pageCount - The number of pages to allocate for primary storage
Returns:
a new FileHeader

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
Following copied from class: org.dbxml.core.filer.Paged
Parameters:
pageCount - The number of pages to allocate for primary storage
pageSize - The size of a Page (should be a multiple of a FS block)
Returns:
a new FileHeader

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
Following copied from class: org.dbxml.core.filer.Paged
Returns:
a new PageHeader

dbXML API

Copyright (c) 1999-2001 The dbXML Group, All rights reserved