|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object vs.VmsStruct com.kednos.jphone.Database
Java interface to Phone Book file.
This class is an extension of the vs.VmsStruct
class.
This means that the instantiated object also represents the current
record.
Constructor Summary | |
Database()
Create the connection to the database file. |
Method Summary | |
void |
clearRecord()
Clear the internal record storage. |
boolean |
deleteRecord()
Delete a record from the file. |
void |
finalize()
Perform final cleanup. |
boolean |
getDateRecord(java.lang.String date,
boolean first,
boolean bday)
Search for a specific record by date. |
boolean |
getMonthRecord(java.lang.String month,
boolean first,
boolean bday)
Search for a specific record by month. |
boolean |
getRecord(java.lang.String name,
boolean first)
Search for a specific record by name. |
void |
writeRecord()
Write the current record to the file. |
Methods inherited from class vs.VmsStruct |
get, get, getTarget, put, put, put, put |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Database()
Initialize the internal record buffer and open the phone book database file.
Method Detail |
public void finalize() throws java.lang.Throwable
Close the phone book file.
java.lang.Throwable
public void clearRecord()
This method clears the internal record storage.
public boolean deleteRecord()
Use this method to remove the current record from the phonebook file.
public void writeRecord()
This method writes the current record to the phone book
file. It does not replace matching records. Use the
deleteRecord()
method first, then write the
record.
public boolean getRecord(java.lang.String name, boolean first)
This method will attempt to locate a record that matches the
specified name
. This is then loaded into the
internal buffer making the record accessible via the
get
and put
methods inherited from
vs.VmsStruct
.
name
- the name to look for. It is in the format
"Last First".first
- begin the search from the first record.
public boolean getMonthRecord(java.lang.String month, boolean first, boolean bday)
This method attempts to find a record with an event that
occurs in the specified month
. This event can
either be a birthday or anniversary. If bday
is true
then birthdays are matched, otherwise
anniversarys are matched.
month
- month to fetch record for. This is the
first three letters of the month.first
- begin the search from the first record.bday
- flag to indicate if the caller is looking for
birthday or anniversary records.
public boolean getDateRecord(java.lang.String date, boolean first, boolean bday)
This method attempts to find a record with an event that
occurs on the specified date
. This event can
either be a birthday or anniversary. If bday
is true
then birthdays are matched, otherwise
anniversarys are matched.
The date is specified as a String
in the
format DDMMM
.
date
- date to fetch record for.first
- begin the search from the first record.bday
- flag to indicate if the caller is looking for
birthday or anniversary records.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |