Synergy Home Page

au.edu.swin.synergy.lib.io
Class BDataFile

java.lang.Object
  |
  +--au.edu.swin.synergy.lib.io.BDataFile

public class BDataFile
extends Object

Author:
John Newbigin
Requirement/analysis/design Reference:
 
Copyright Belongs To:
Synergy Software
See Also:

Inner Class Summary
static class BDataFile.ClassMap
           
 
Constructor Summary
BDataFile(String fFileName)
           
 
Method Summary
 void addData(String fKey, String fData)
           
 void addData(String fKey, String fData, String fDefault)
          Add a key=data to the file, but only if data != default Handling is done for null
 void addTag(String fTag)
           
 BSaveable autoLoad()
           
 void close()
          close an open file
 String getData(String fKey, String fDefault)
           
 String getFileName()
           
 Object getUserObject()
           
 boolean load(BSaveable object)
           
 boolean openFileForRead()
          openFileForRead
 boolean openFileForWrite(boolean append)
          opens a file for writing
 boolean save(BSaveable object)
           
 void setUserObject(Object fObject)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BDataFile

public BDataFile(String fFileName)
Method Detail

getFileName

public String getFileName()

save

public boolean save(BSaveable object)

load

public boolean load(BSaveable object)

autoLoad

public BSaveable autoLoad()

setUserObject

public void setUserObject(Object fObject)

getUserObject

public Object getUserObject()

openFileForRead

public boolean openFileForRead()
openFileForRead
Returns:
true if the file could be opened, otherwise false
Post Condition:
the file is opened for reading

openFileForWrite

public boolean openFileForWrite(boolean append)
opens a file for writing
Parameters:
append - if append is false, then any existing data will be overwritten
Returns:
true if the file could be opened
Post Condition:
the file is opened for writing

close

public void close()
close an open file
Pre Condition:
the file is open
Post Condition:
the file is closed

addTag

public void addTag(String fTag)

addData

public void addData(String fKey,
                    String fData,
                    String fDefault)
Add a key=data to the file, but only if data != default Handling is done for null

addData

public void addData(String fKey,
                    String fData)

getData

public String getData(String fKey,
                      String fDefault)

Synergy Home Page