addbk.JAddressBook
Class AddressDataBase

java.lang.Object
  extended by java.util.Observable
      extended by addbk.JAddressBook.AddressDataBase

public final class AddressDataBase
extends java.util.Observable


Method Summary
 void addRecord(AddressRecord abr)
           
 void addRecord(java.lang.String s, DelimiterBean db)
          Add s, assuming it contains one records and is parsed using db.
static void beep()
           
 void deleteCurrentRecord()
           
 void deleteRecord(AddressRecord abr)
           
static boolean equal(AddressRecord ar1, AddressRecord ar2)
           
 void exportCsv(DelimiterBean db)
           
 AddressRecord find(FindBean findBean)
          Use the findBean to locate an address record.
 void findLetter(java.lang.String text)
          Search the database until you find the letter or the letter just previous to it.
 void findRecordAndSetToCurrent(AddressRecord value)
           
 void findRecordAndSetToCurrentNoUpdate(AddressRecord value)
           
static AddressDataBase getAddressBookDatabase()
           
 java.util.Vector getAddressVector()
           
 AddressRecord getCurrentRecord()
           
 AddressRecord getNextRecord()
           
 AddressRecord[] getNextRecords(int n)
          getN records from addressbook.
 AddressRecord getPreviousRecord()
           
 AddressRecord getRecordAt(int recNumber)
           
 int getRecordNumber()
           
 java.lang.String getSaveFileName()
           
 int getSize()
           
 void gotoFirstRecord()
           
 void init()
           
 boolean isModifiedButNotSaved()
           
static void main(java.lang.String[] args)
           
 void mergeAdb()
           
 void mergeUsingDelimiters(DelimiterBean db)
           
 void mergeXml()
           
 void mergeXml(java.lang.String xmlString)
           
 void next(int numberOfRows)
           
 void openEncryptedGzDb()
           
 void openGzDb(CipherBean cb, java.io.File f)
           
 void openGzDb(java.lang.String readFileName)
           
 void previous(int numberOfRows)
           
 void print()
           
 AddressRecord readRecord()
           
 void removeDuplicates()
           
 void replaceCurrentRecord(AddressRecord ar)
           
 void save()
           
 void saveAsXml()
           
 void saveEncryptedGzDb()
           
 void saveGzDb()
           
 void saveGzDb(CipherBean cb)
           
 void saveGzDb(CipherBean cb, java.io.File writeFile)
           
 void saveGzDb(java.lang.String uidPw)
           
 void saveGzippedDb()
           
 void setAddressVector(java.util.Vector addressVector)
           
 void setRecordNumber(int recordNumber)
           
 void sort()
           
 void top()
           
 java.lang.String toString()
           
 void update()
           
 
Methods inherited from class java.util.Observable
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getAddressBookDatabase

public static AddressDataBase getAddressBookDatabase()

update

public void update()

mergeUsingDelimiters

public void mergeUsingDelimiters(DelimiterBean db)

addRecord

public void addRecord(java.lang.String s,
                      DelimiterBean db)
Add s, assuming it contains one records and is parsed using db.

Parameters:
s - string with record
db - has field and line delimiters

saveAsXml

public void saveAsXml()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

sort

public void sort()

readRecord

public AddressRecord readRecord()

getRecordAt

public AddressRecord getRecordAt(int recNumber)

addRecord

public void addRecord(AddressRecord abr)

deleteRecord

public void deleteRecord(AddressRecord abr)

getSize

public int getSize()
Returns:
size of the currently held database

deleteCurrentRecord

public void deleteCurrentRecord()

saveGzippedDb

public void saveGzippedDb()

mergeAdb

public void mergeAdb()

removeDuplicates

public void removeDuplicates()

equal

public static boolean equal(AddressRecord ar1,
                            AddressRecord ar2)

openGzDb

public void openGzDb(java.lang.String readFileName)
              throws java.io.IOException
Throws:
java.io.IOException

openEncryptedGzDb

public void openEncryptedGzDb()

openGzDb

public void openGzDb(CipherBean cb,
                     java.io.File f)
              throws java.io.IOException,
                     java.security.InvalidKeyException
Throws:
java.io.IOException
java.security.InvalidKeyException

saveGzDb

public void saveGzDb()
              throws java.io.IOException
Throws:
java.io.IOException

saveEncryptedGzDb

public void saveEncryptedGzDb()

saveGzDb

public void saveGzDb(java.lang.String uidPw)
              throws java.io.IOException,
                     java.security.InvalidKeyException,
                     java.security.NoSuchAlgorithmException,
                     javax.crypto.NoSuchPaddingException
Throws:
java.io.IOException
java.security.InvalidKeyException
java.security.NoSuchAlgorithmException
javax.crypto.NoSuchPaddingException

saveGzDb

public void saveGzDb(CipherBean cb)
              throws java.io.IOException,
                     java.security.InvalidKeyException
Throws:
java.io.IOException
java.security.InvalidKeyException

saveGzDb

public void saveGzDb(CipherBean cb,
                     java.io.File writeFile)
              throws java.io.IOException,
                     java.security.InvalidKeyException
Throws:
java.io.IOException
java.security.InvalidKeyException

getCurrentRecord

public AddressRecord getCurrentRecord()

beep

public static void beep()

getPreviousRecord

public AddressRecord getPreviousRecord()

getNextRecord

public AddressRecord getNextRecord()

exportCsv

public void exportCsv(DelimiterBean db)

find

public AddressRecord find(FindBean findBean)
Use the findBean to locate an address record. Return it if you find it, otherwise return null. Set the recordNumber, if you find the record, otherwise leave it alone.


init

public void init()

top

public void top()

replaceCurrentRecord

public void replaceCurrentRecord(AddressRecord ar)

findRecordAndSetToCurrentNoUpdate

public void findRecordAndSetToCurrentNoUpdate(AddressRecord value)

findRecordAndSetToCurrent

public void findRecordAndSetToCurrent(AddressRecord value)

getAddressVector

public java.util.Vector getAddressVector()

setAddressVector

public void setAddressVector(java.util.Vector addressVector)

getRecordNumber

public int getRecordNumber()

setRecordNumber

public void setRecordNumber(int recordNumber)

mergeXml

public void mergeXml()

mergeXml

public void mergeXml(java.lang.String xmlString)

print

public void print()

main

public static void main(java.lang.String[] args)

getNextRecords

public AddressRecord[] getNextRecords(int n)
getN records from addressbook. Do not notify observers. start at the recordNumber location. If there are no records, the first element will be null.


findLetter

public void findLetter(java.lang.String text)
Search the database until you find the letter or the letter just previous to it.


previous

public void previous(int numberOfRows)

next

public void next(int numberOfRows)

save

public void save()
          throws java.io.IOException
Throws:
java.io.IOException

getSaveFileName

public java.lang.String getSaveFileName()

isModifiedButNotSaved

public boolean isModifiedButNotSaved()

gotoFirstRecord

public void gotoFirstRecord()