org.xBaseJ.rmi
Class DBF

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by org.xBaseJ.rmi.DBF
All Implemented Interfaces:
java.io.Serializable, java.rmi.Remote, DBFInterface

public class DBF
extends java.rmi.server.UnicastRemoteObject
implements DBFInterface

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Fields inherited from interface org.xBaseJ.rmi.DBFInterface
serviceName
 
Constructor Summary
DBF(java.lang.String inDBFName)
          Constructor
 
Method Summary
 void close()
          closes the database
 void delete()
          marks the current records as deleted
 boolean deleted()
          returns true if record is marked for deletion
 boolean find(java.lang.String keyString)
          used to find a record with an equal or greater string value when done the record pointer and field contents will be changed
 void findNext()
          used to get the next record in the index list when done the record pointer and field contents will be changed
 void findPrev()
          used to get the previous record in the index list when done the record pointer and field contents will be changed
 int getCurrentRecordNumber()
          returns the current record number
 FieldInterface getField(int i)
          returns a Field type by its relative position
 FieldInterface getField(java.lang.String name)
          returns a Field type by its name in the database
 int getFieldCount()
          returns the number of fields in a database
 int getRecordCount()
          returns the number of records in a database
 void gotoRecord(int recno)
          used to read a record at a particular place in the database when done the record pointer and field contents will be changed
 void read()
          used to read the next record, after the current record pointer, in the database when done the record pointer and field contents will be changed
 void readPrev()
          used to read the previous record, before the current record pointer, in the database when done the record pointer and field contents will be changed
 void startBottom()
          used to position record pointer at the last record or index in the database when done the record pointer will be changed.
 void startTop()
          used to position record pointer at the first record or index in the database when done the record pointer will be changed.
 void undelete()
          marks the current records as not deleted
 void update()
          updates the record at the current position
 void useIndex(java.lang.String filename)
          opens an Index file associated with the database.
 void useTag(java.lang.String tagname)
          associates all Index operations with an existing tag
 void write()
          used to write a new record in the database when done the record pointer is at the end of the database
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DBF

public DBF(java.lang.String inDBFName)
    throws java.rmi.RemoteException
Constructor

Throws:
java.rmi.RemoteException
Method Detail

getFieldCount

public int getFieldCount()
                  throws java.rmi.RemoteException
returns the number of fields in a database

Specified by:
getFieldCount in interface DBFInterface
Throws:
java.rmi.RemoteException

getRecordCount

public int getRecordCount()
                   throws java.rmi.RemoteException
returns the number of records in a database

Specified by:
getRecordCount in interface DBFInterface
Throws:
java.rmi.RemoteException

getCurrentRecordNumber

public int getCurrentRecordNumber()
                           throws java.rmi.RemoteException
returns the current record number

Specified by:
getCurrentRecordNumber in interface DBFInterface
Throws:
java.rmi.RemoteException

useIndex

public void useIndex(java.lang.String filename)
              throws java.rmi.RemoteException
opens an Index file associated with the database. This index becomes the primary index used in subsequent find methods.

Specified by:
useIndex in interface DBFInterface
Parameters:
filename - an existing ndx file(can be full or partial pathname) or mdx tag
Throws:
java.rmi.RemoteException - org.xBaseJ Fields defined in index do not match fields in database

useTag

public void useTag(java.lang.String tagname)
            throws java.rmi.RemoteException
associates all Index operations with an existing tag

Specified by:
useTag in interface DBFInterface
Parameters:
tagname - an existing tag name in the production MDX file
Throws:
java.rmi.RemoteException - no MDX file tagname not found

find

public boolean find(java.lang.String keyString)
             throws java.rmi.RemoteException
used to find a record with an equal or greater string value when done the record pointer and field contents will be changed

Specified by:
find in interface DBFInterface
Parameters:
keyString - a search string
Returns:
boolean indicating if the record found contains the exact key
Throws:
java.rmi.RemoteException - org.xBaseJ no Indexs opened with database

findNext

public void findNext()
              throws java.rmi.RemoteException
used to get the next record in the index list when done the record pointer and field contents will be changed

Specified by:
findNext in interface DBFInterface
Throws:
java.rmi.RemoteException - org.xBaseJ Index not opened or not part of the database eof - end of file

findPrev

public void findPrev()
              throws java.rmi.RemoteException
used to get the previous record in the index list when done the record pointer and field contents will be changed

Specified by:
findPrev in interface DBFInterface
Throws:
java.rmi.RemoteException - org.xBaseJ Index not opened or not part of the database tof - top of file

read

public void read()
          throws java.rmi.RemoteException
used to read the next record, after the current record pointer, in the database when done the record pointer and field contents will be changed

Specified by:
read in interface DBFInterface
Throws:
java.rmi.RemoteException - usually the end of file condition

readPrev

public void readPrev()
              throws java.rmi.RemoteException
used to read the previous record, before the current record pointer, in the database when done the record pointer and field contents will be changed

Specified by:
readPrev in interface DBFInterface
Throws:
java.rmi.RemoteException - usually the top of file condition

gotoRecord

public void gotoRecord(int recno)
                throws java.rmi.RemoteException
used to read a record at a particular place in the database when done the record pointer and field contents will be changed

Specified by:
gotoRecord in interface DBFInterface
Parameters:
recno - the relative position of the record to read
Throws:
java.rmi.RemoteException - passed an negative number, 0 or value greater than the number of records in database

startTop

public void startTop()
              throws java.rmi.RemoteException
used to position record pointer at the first record or index in the database when done the record pointer will be changed. NO RECORD IS READ. Your program should follow this with either a read (for non-index reads) or findNext (for index processing)

Specified by:
startTop in interface DBFInterface
Throws:
java.rmi.RemoteException - most likely no records in database

startBottom

public void startBottom()
                 throws java.rmi.RemoteException
used to position record pointer at the last record or index in the database when done the record pointer will be changed. NO RECORD IS READ. Your program should follow this with either a read (for non-index reads) or findPrev (for index processing)

Specified by:
startBottom in interface DBFInterface
Throws:
java.rmi.RemoteException - most likely no records in database

write

public void write()
           throws java.rmi.RemoteException
used to write a new record in the database when done the record pointer is at the end of the database

Specified by:
write in interface DBFInterface
Throws:
java.rmi.RemoteException - any one of several errors

update

public void update()
            throws java.rmi.RemoteException
updates the record at the current position

Specified by:
update in interface DBFInterface
Throws:
java.rmi.RemoteException - any one of several errors

delete

public void delete()
            throws java.rmi.RemoteException
marks the current records as deleted

Specified by:
delete in interface DBFInterface
Throws:
java.rmi.RemoteException - usually occurs when no record has been read

undelete

public void undelete()
              throws java.rmi.RemoteException
marks the current records as not deleted

Specified by:
undelete in interface DBFInterface
Throws:
java.rmi.RemoteException - usually occurs when no record has been read.

deleted

public boolean deleted()
                throws java.rmi.RemoteException
returns true if record is marked for deletion

Specified by:
deleted in interface DBFInterface
Returns:
boolean true if record is marked for deletion
Throws:
java.rmi.RemoteException

close

public void close()
           throws java.rmi.RemoteException
closes the database

Specified by:
close in interface DBFInterface
Throws:
java.rmi.RemoteException

getField

public FieldInterface getField(int i)
                        throws java.rmi.RemoteException
returns a Field type by its relative position

Specified by:
getField in interface DBFInterface
Parameters:
i - Field number
Returns:
char
Throws:
java.rmi.RemoteException - Field name is not correct

getField

public FieldInterface getField(java.lang.String name)
                        throws java.rmi.RemoteException
returns a Field type by its name in the database

Specified by:
getField in interface DBFInterface
Parameters:
name - Field name
Throws:
java.rmi.RemoteException - Field name is not correct