net.sourceforge.neurosdbm.db
Class MDBRecord

java.lang.Object
  extended bynet.sourceforge.neurosdbm.db.MDBRecord
Direct Known Subclasses:
AdvAudioRecord, AlbumRecord, ArtistRecord, AudioRecord, FailedHiSiRecord, GenreRecord, IdedHiSiRecord, NullRecord, PlaylistRecord, RecordingRecord, UnidedHiSiRecord

public abstract class MDBRecord
extends java.lang.Object


Field Summary
protected  java.util.ArrayList accessKeyArrayList
           
private  int countedLength
           
protected  boolean deleted
           
protected  java.util.ArrayList extraInfoArrayList
           
protected  int key
           
protected  WordString primary
           
private  int recordLength
           
 
Constructor Summary
protected MDBRecord(int key)
           
  MDBRecord(int key, java.nio.ByteBuffer bytes, int wordOffset, int numAccessKeys, int numExtraInfo)
           
 
Method Summary
private  int computeRecordLength()
          Computes the length of this record in bytes.
(package private) abstract  void generatePointers()
           
(package private)  int getCountedLength()
          This function returns the counted length of this record (the actual size in bytes of the record on disk when read.) This value is only valid if the MDBRecord has been loaded from disk.
(package private)  int getKey()
           
 WordString getPrimary()
           
(package private)  int getRecordLength()
          Returns the length of this record (in bytes.) Record lenghts are computed lazily, and are only computed when needed (a generatePointers by controling MDB file.)
(package private)  void invalidateRecordLength()
          This function invalidates the computed record length.
 java.lang.String toString()
           
(package private)  void write(NIOFile file)
          This function writes this record to the end of of the passed in NIOFile.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

recordLength

private int recordLength

countedLength

private int countedLength

deleted

protected boolean deleted

primary

protected WordString primary

accessKeyArrayList

protected java.util.ArrayList accessKeyArrayList

extraInfoArrayList

protected java.util.ArrayList extraInfoArrayList

key

protected int key
Constructor Detail

MDBRecord

protected MDBRecord(int key)

MDBRecord

public MDBRecord(int key,
                 java.nio.ByteBuffer bytes,
                 int wordOffset,
                 int numAccessKeys,
                 int numExtraInfo)
Method Detail

generatePointers

abstract void generatePointers()

getCountedLength

int getCountedLength()
This function returns the counted length of this record (the actual size in bytes of the record on disk when read.) This value is only valid if the MDBRecord has been loaded from disk.


invalidateRecordLength

void invalidateRecordLength()
This function invalidates the computed record length. This function must be called if the record length is changed in any way. For example if a playlist is added to an audio record.


getRecordLength

int getRecordLength()
Returns the length of this record (in bytes.) Record lenghts are computed lazily, and are only computed when needed (a generatePointers by controling MDB file.)


computeRecordLength

private int computeRecordLength()
Computes the length of this record in bytes.


write

void write(NIOFile file)
     throws java.io.IOException,
            DatabaseInternalCorruptionException
This function writes this record to the end of of the passed in NIOFile.

Throws:
java.io.IOException
DatabaseInternalCorruptionException

getKey

int getKey()

toString

public java.lang.String toString()

getPrimary

public WordString getPrimary()


Copyright © 2004 NeurosDBM Dev Team All Rights Reserved.