|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectc408h003.omnieditor.OmniEditorBuffer
Constructor Summary | |
OmniEditorBuffer()
Constructs a OmniEditorBuffer. |
Method Summary | |
void |
addFile(int userId,
java.lang.String filename,
java.lang.String content)
Adds a file into the editing buffer. |
int |
find(int userId,
int start,
java.lang.String target,
java.lang.String fileName,
boolean forward,
boolean caseSensitive)
Finds a string in a file. |
java.lang.String[] |
getChanges(int userId,
java.lang.String fileName)
Gets all changes (actions) performed. |
java.lang.String[] |
getFileContent(int userId,
java.lang.String[] fileNames)
Returns the content of a file in the buffer specified by file ID. |
java.lang.String[] |
getFileNames()
Gets all names of the files currently in the buffer. |
boolean |
isFileOnline(java.lang.String filename)
Checks whether the file is in the editing buffer. |
boolean |
isUserOnline(int userId)
Checks whether the user is registered. |
static void |
main(java.lang.String[] args)
|
int |
registerUser()
Resgisters a user and assign an identification number to him/her. |
void |
removeFile(File file)
Removes a file from the buffer. |
void |
removeFileByName(java.lang.String fileName)
|
void |
removeUser(int userId)
Removes a user from the buffer. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public OmniEditorBuffer()
Method Detail |
public static void main(java.lang.String[] args)
public int registerUser()
public void removeUser(int userId)
userId
- the to-be-removed user's idpublic boolean isUserOnline(int userId)
userId
- the name or ID of a user
userId
is an id number in the user list
false, otherwisepublic boolean isFileOnline(java.lang.String filename)
filename
- the name of a file
public void addFile(int userId, java.lang.String filename, java.lang.String content)
userId
- the id number who's adding filefilename
- the name of the filecontent
- the content of the file
public java.lang.String[] getFileContent(int userId, java.lang.String[] fileNames)
userId
- the id number of the userfileNames
- the name of the files whose contents are required
null
if file(s) does not existpublic int find(int userId, int start, java.lang.String target, java.lang.String fileName, boolean forward, boolean caseSensitive)
userId
- the id number of the userstart
- the position from where we search for the stringtarget
- the target string to be looked forfileName
- the file in which the string should be searchedforward
- true if search forwards, false for backwardscaseSensitive
- true if need to search case sensitive, false otherwise
public java.lang.String[] getFileNames()
public java.lang.String[] getChanges(int userId, java.lang.String fileName)
userId
- the user who wants the change of the filefileName
- the name of the file which the changes want to be fetched
public void removeFile(File file)
file
- the file wants to be removed.public void removeFileByName(java.lang.String fileName)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |