|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectc408h003.omnieditor.File
Constructor Summary | |
File(java.lang.String fileName,
java.lang.String content)
Constructs a File object with name and id. |
Method Summary | |
boolean |
addAction(Action act)
|
int |
addUser()
Adds a user to the list of users current editing the file. |
java.lang.String |
delete()
Removes a previously selected string. |
int |
find(int start,
java.lang.String target,
boolean fwd,
boolean caseSensitive)
The following are methods providing editing functionalities, such as find, move, insert, etc. |
Action |
getAction(int index)
Gets the index-th action performed on this file. |
java.lang.String |
getContent()
Gets the contents of the file, as a string. |
java.lang.String |
getName()
Gets the file's name. |
int |
getUserCount()
Gets the number of users currently working on the file. |
int |
getVersionNumber()
Gets the current working version of the file. |
void |
mark(int position)
Marks a start position for the following select operation. |
void |
move(int newPos)
Moves the cursor to new position. |
int |
removeUser()
Removes a user ID from the list of the users who is editing the file |
java.lang.String |
select(int position)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public File(java.lang.String fileName, java.lang.String content)
fileName
- name of the Filecontent
- the contents of the fileMethod Detail |
public int addUser()
public int removeUser()
public int find(int start, java.lang.String target, boolean fwd, boolean caseSensitive) throws java.lang.NullPointerException
java.lang.NullPointerException
public void move(int newPos)
newPos
- the new position of the cursorpublic void mark(int position) throws java.lang.IndexOutOfBoundsException
position
- the current position of the cursor
IllegalPositionException
- if the position
is not within the bound of the file, throw this Exception.
java.lang.IndexOutOfBoundsException
public java.lang.String select(int position) throws java.lang.IndexOutOfBoundsException
java.lang.IndexOutOfBoundsException
public java.lang.String delete()
public java.lang.String getContent()
public java.lang.String getName()
public int getVersionNumber()
public Action getAction(int index)
index
- the action number you want to have.
Action
objectpublic boolean addAction(Action act)
public int getUserCount()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |