## xbase
Class XbaseFile

    java.lang.Object
      |
      +--xbase.XbaseFile

Direct Known Subclasses:
  AlbnoteFile, AlbumFile, LeaderFile, MusFile, MusicianFile, MusicianSessionFile, TuneFile, TuneSessionFile, TunFile

public abstract class XbaseFile
extends java.lang.Object

Field Summary
`protected DBFile` `dbfile`

Constructor Summary
`XbaseFile(java.lang.String fileName, int[] key)` Open the file.

Method Summary
`protected void` `addIndex(java.lang.String fileName, int keyNumber, XbaseKey keyMaker)` Add the named index file.
`protected boolean` `getBooleanField(byte[] buf, int fnum)`
`XbaseIndex` `getIndex(int keyno)` Get an index to navigate with.
`protected int` `getIntField(byte[] buf, int fnum)` Get an integer field from the current record.
`int` `getNumberOfRecords()` Get the number of data records in the file.
`protected java.lang.String` `getStringField(byte[] buf, int fnum)`
`protected abstract void` `loadFields(byte[] buf, XbaseRecord rec)`
`static java.lang.String` `pad(int val, int len)` Utility routine to pad a numeric field to a number of digits.
`boolean` `read(XbaseRecord rec, int recno)` Read the given record number into the record.
`void` `releaseIndex(XbaseIndex idx)` Give up the index for something else to use.
`static java.lang.String` `spacePad(java.lang.String val, int len)` Utility routine to pad an alpha field to a number of characters.

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

Field Detail

### dbfile

    protected DBFile dbfile

Constructor Detail

### XbaseFile

    public XbaseFile(java.lang.String fileName,
                     int[] key)
              throws java.io.IOException

  Open the file.
  Parameters:
    `fileName` - The pathname of the file, without the trailing ".DBF".

Method Detail

### addIndex

    protected void addIndex(java.lang.String fileName,
                            int keyNumber,
                            XbaseKey keyMaker)
                     throws java.io.IOException

  Add the named index file.

### getIndex

    public XbaseIndex getIndex(int keyno)
                        throws java.io.IOException

  Get an index to navigate with.

### releaseIndex

    public void releaseIndex(XbaseIndex idx)

  Give up the index for something else to use. Make sure to set the XbaseIndex to null after calling.

### pad

    public static java.lang.String pad(int val,
                                       int len)

  Utility routine to pad a numeric field to a number of digits.

### spacePad

    public static java.lang.String spacePad(java.lang.String val,
                                            int len)

  Utility routine to pad an alpha field to a number of characters.

### getNumberOfRecords

    public int getNumberOfRecords()

  Get the number of data records in the file.

### read

    public boolean read(XbaseRecord rec,
                        int recno)
                 throws java.io.IOException

  Read the given record number into the record.

### loadFields

    protected abstract void loadFields(byte[] buf,
                                       XbaseRecord rec)

### getIntField

    protected int getIntField(byte[] buf,
                              int fnum)

  Get an integer field from the current record.
  Parameters:
    `fnum` - Field number, starting at zero
  Returns:
    The int value of the field.

### getStringField

    protected java.lang.String getStringField(byte[] buf,
                                              int fnum)

### getBooleanField

    protected boolean getBooleanField(byte[] buf,
                                      int fnum)