|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.avian.util.BirdHistoryFile
public class BirdHistoryFile
Utility object that manages all of the messy details of writing the history of a bird to a file. The writing of a bird history is done all at once, so the open and close are part of the same try-catch block. In the future it may be preferable to write one line or one chunk of data at a time, but we'll update this object at the time when we need that ability.
Constructor Summary | |
---|---|
BirdHistoryFile(java.lang.String fileName,
java.lang.String action)
The only constructor that is defined for this helper object. |
Method Summary | |
---|---|
java.lang.String |
getFileName()
Returns the fileName that is currently set in this helper object. |
void |
openAndWrite(java.lang.String birdHistory)
Opens the fileName that was set when this object was created and writes the String that is passed to this method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BirdHistoryFile(java.lang.String fileName, java.lang.String action)
fileName
- String that contains the path and file name to write to.action
- String that describes how the file should be opened. If the String
equals "New" then the file will be opened and discard any previous contents of
the file. If the String does not equal "New" then it will open and append any
additional contents to the file.Method Detail |
---|
public java.lang.String getFileName()
public void openAndWrite(java.lang.String birdHistory)
birdHistory
- String that contains a complete bird history.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |