au.edu.swin.synergy.lib.io
Class BTextdbRecord
java.lang.Object
|
+--au.edu.swin.synergy.lib.io.BTextdbRecord
- public class BTextdbRecord
- extends Object
This class maintains a list of strings which equate to fields in a database record
These fields can then be written to a single string which can be stored in a file
see BTextdb
The format is
field 0:field 1:"field with a : in it":etc...
see sample test class for details
- Author:
- John Newbigin
- Requirement/analysis/design Reference:
-
- Copyright Belongs To:
- Synergy Software
- See Also:
BTextdb
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
BTextdbRecord
public BTextdbRecord()
getElement
public String getElement(int index)
- Get an element of the record
- Parameters:
index
- a 0 based index into this record- Returns:
- a string, containg the data in the requested field
- Pre Condition:
- the record data has been set
setElement
public void setElement(int index,
String data)
- Set the specified element to the specified string
- Parameters:
index
- a 0 based index into this recorddata
- the string to set the element to- Pre Condition:
- the record data has been set
- Post Condition:
- the element has been updated
getCount
public int getCount()
- Return the number of elements in this record
- Returns:
- the number of elements
- Pre Condition:
- the record data has been set
getRecord
public String getRecord()
- Get the record as a string suitable for writing to file
- Returns:
- a string representation of the record
- Pre Condition:
- the record data has been set
setRecord
public void setRecord(String data)
- Sets the data for the record
- Parameters:
data
- a string of data read from the database file- Post Condition:
- the record data is set
addElement
public void addElement(String data)
- Add a new element to the record
- Parameters:
data
- a string of data to add- Post Condition:
- the new element is added to the end of the element list