|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--JFile | +--TextFile
A TextFile is a JFile that holds text.
Field Summary |
Fields inherited from class JFile |
separator |
Constructor Summary | |
TextFile(String name,
User creator,
Directory parent,
String initialContents)
Construct a TextFile with initial contents. |
Method Summary | |
void |
append(String text)
Append text to the end of the file. |
void |
appendLine(String text)
Append a new line of text to the end of the file. |
String |
getContents()
The contents of a text file. |
int |
getSize()
The size of a text file is the number of characters stored. |
String |
getSuffix()
Suffix used for printing text file names is "". |
void |
setContents(String contents)
Replace the contents of the file. |
Methods inherited from class JFile |
getCreateDate, getModDate, getName, getOwner, getParent, getPathName, isRoot, setModDate, setOwner, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public TextFile(String name, User creator, Directory parent, String initialContents)
name
- the name for this TextFile (in its parent Directory)creator
- the owner of this new TextFileparent
- the Directory in which this TextFile lives.initialContents
- the initial textMethod Detail |
public void append(String text)
text
- the text to be appended.public void appendLine(String text)
text
- the text to be appended.public String getContents()
public int getSize()
getSize
in class JFile
public String getSuffix()
getSuffix
in class JFile
public void setContents(String contents)
contents
- the new contents.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |