|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
This interface defines all the text data access methods. Wherever addresses are involved in creating new resources, all non-existing collections in the specified path to the resource will be created automatically.
All the methods throw the following exceptions:
| Method Summary | |
String |
getText(String address,
int beginIndex,
int endIndex)
Retrieves the specified text data from the resource at the given address. |
void |
insertText(String address,
int atIndex,
String newContent)
Inserts the new text content into the resource starting at the index specified. |
void |
replaceText(String address,
int beginIndex,
int endIndex,
String newContent)
Replaces the specified text with the new content. |
boolean |
storeText(String address,
String content,
boolean force)
Creates a new text resource and writes the given content into it. |
| Method Detail |
public String getText(String address,
int beginIndex,
int endIndex)
throws MalformedAddressException,
ResourceNotFoundException,
IndexOutOfBoundsException,
IOException
address - address of the resourcebeginIndex - the beginning index, inclusive.endIndex - the endIndex, exclusive.
ResourceNotFoundException - if the resource doesnt exist
IndexOutOfBoundsException - if the beginIndex is negative, or beginIndex is larger than endIndex and endIndex is not EOF.
MalformedAddressException
IOException
public boolean storeText(String address,
String content,
boolean force)
throws MalformedAddressException,
IOException
address - the address of the resourcecontent - the data to be writtenforce - if true then the resource is overwritten if it already exists
MalformedAddressException
IOException
public void insertText(String address,
int atIndex,
String newContent)
throws MalformedAddressException,
ResourceNotFoundException,
IndexOutOfBoundsException,
IOException
address - the address of the resourceatIndex - offset from the beginning of the resourcenewContent - text to be inserted
ResourceNotFoundException - if the resource doesnt exist
IndexOutOfBoundsException - if the atIndex is negative and not EOF
MalformedAddressException
IOException
public void replaceText(String address,
int beginIndex,
int endIndex,
String newContent)
throws MalformedAddressException,
ResourceNotFoundException,
IndexOutOfBoundsException,
IOException
address - address of the resourcebeginIndex - beginning index, inclusiveendIndex - end index, exclusivenewContent - new content to replace the text
ResourceNotFoundException - if the resource doesnt exist
IndexOutOfBoundsException - if the beginIndex is negative, or beginIndex is larger than endIndex and endIndex is not EOF.
MalformedAddressException
IOException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||