net.sourceforge.neurosdbm.db
Class AlbumsMDB

java.lang.Object
  extended bynet.sourceforge.neurosdbm.db.MDB
      extended bynet.sourceforge.neurosdbm.db.AlbumsMDB

public final class AlbumsMDB
extends MDB


Field Summary
protected  Word attributes
           
protected  Word db_ID
           
protected  DisplayData db_Name
           
(package private) static int DBTYPE_AUDIO
           
(package private) static int DBTYPE_PCAUDIO
           
protected  java.lang.String fileName
           
protected  java.util.Map keysToMDBRecordsMap
           
protected  java.util.Map keysToWordPointersMap
           
protected  int nextKey
           
protected  WordPointer nullPtr
           
protected  Word numOfFieldsPerRecord
           
protected  Word numOfKeys
           
protected  WordString parentDBFilename
           
protected  WordPointerToDisplayData pDB_Name
           
protected  WordPointerToWordString pParentDBFilename
           
protected  Rule[] pRules
           
protected  WordPointer pXIM
           
protected  WordPointer recordStart
           
protected  Word status
           
private  int type
           
protected  boolean useDBname
           
protected  byte[] ximData
           
 
Constructor Summary
AlbumsMDB(java.lang.String fileName, int type)
           
AlbumsMDB(java.lang.String fileName, int type, boolean createEmpty)
           
 
Method Summary
(package private)  int addNewTrack(java.lang.String album, AlbumsSAI albumsSAI, PAI albumsPAI, int audioKey)
           
(package private)  void computeHeaderPointers()
          This function computes the pointers used in the header.
private  void createEmptyDatabase()
           
(package private)  void deleteRecord(int key)
           
(package private)  void generatePointers()
           
(package private)  java.lang.String getAlbum(int key)
           
(package private)  int getKey(WordPointer ptr)
           
(package private)  MDBRecord getMDBRecord(int key)
           
(package private)  MDBRecord getMDBRecord(java.lang.Integer key)
          Returns the MDB record given the key from this object's MDB database.
(package private)  WordPointer getPointer(int key)
           
private  void loadExistingDatabase()
           
protected  int numAccessKeys()
           
protected  int numExtraInfo()
           
protected  void parseMDBHeader(java.nio.ByteBuffer bytes)
           
 java.lang.String toString()
           
(package private)  void write()
           
protected  void write(NIOFile file)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DBTYPE_AUDIO

static final int DBTYPE_AUDIO
See Also:
Constant Field Values

DBTYPE_PCAUDIO

static final int DBTYPE_PCAUDIO
See Also:
Constant Field Values

type

private int type

fileName

protected java.lang.String fileName

attributes

protected Word attributes

useDBname

protected boolean useDBname

status

protected Word status

numOfKeys

protected Word numOfKeys

numOfFieldsPerRecord

protected Word numOfFieldsPerRecord

recordStart

protected WordPointer recordStart

pXIM

protected WordPointer pXIM

db_ID

protected Word db_ID

pDB_Name

protected WordPointerToDisplayData pDB_Name

pParentDBFilename

protected WordPointerToWordString pParentDBFilename

pRules

protected Rule[] pRules

db_Name

protected DisplayData db_Name

parentDBFilename

protected WordString parentDBFilename

ximData

protected byte[] ximData

nullPtr

protected WordPointer nullPtr

keysToMDBRecordsMap

protected java.util.Map keysToMDBRecordsMap

keysToWordPointersMap

protected java.util.Map keysToWordPointersMap

nextKey

protected int nextKey
Constructor Detail

AlbumsMDB

public AlbumsMDB(java.lang.String fileName,
                 int type)
          throws java.io.FileNotFoundException,
                 java.io.IOException,
                 DatabaseCorruptException

AlbumsMDB

public AlbumsMDB(java.lang.String fileName,
                 int type,
                 boolean createEmpty)
          throws java.io.FileNotFoundException,
                 java.io.IOException,
                 DatabaseCorruptException
Method Detail

loadExistingDatabase

private void loadExistingDatabase()
                           throws java.io.FileNotFoundException,
                                  java.io.IOException,
                                  DatabaseCorruptException
Throws:
java.io.FileNotFoundException
java.io.IOException
DatabaseCorruptException

createEmptyDatabase

private void createEmptyDatabase()
                          throws DatabaseCorruptException
Throws:
DatabaseCorruptException

write

void write()
     throws java.io.IOException,
            DatabaseInternalCorruptionException
Overrides:
write in class MDB
Throws:
java.io.IOException
DatabaseInternalCorruptionException

addNewTrack

int addNewTrack(java.lang.String album,
                AlbumsSAI albumsSAI,
                PAI albumsPAI,
                int audioKey)
          throws DatabaseInternalCorruptionException
Throws:
DatabaseInternalCorruptionException

getAlbum

java.lang.String getAlbum(int key)

parseMDBHeader

protected void parseMDBHeader(java.nio.ByteBuffer bytes)

write

protected void write(NIOFile file)
              throws java.io.IOException,
                     DatabaseInternalCorruptionException
Throws:
java.io.IOException
DatabaseInternalCorruptionException

numAccessKeys

protected int numAccessKeys()

numExtraInfo

protected int numExtraInfo()

generatePointers

void generatePointers()

computeHeaderPointers

void computeHeaderPointers()
This function computes the pointers used in the header.


getMDBRecord

MDBRecord getMDBRecord(java.lang.Integer key)
Returns the MDB record given the key from this object's MDB database. The MDB record will have to be downcasted to a specific MDB record type.

Parameters:
key - The key!
Returns:
The record!

getMDBRecord

MDBRecord getMDBRecord(int key)

getKey

int getKey(WordPointer ptr)

getPointer

WordPointer getPointer(int key)

deleteRecord

void deleteRecord(int key)

toString

public java.lang.String toString()


Copyright © 2004 NeurosDBM Dev Team All Rights Reserved.