01: /*
02: * Copyright 2006 Google Inc.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
05: * use this file except in compliance with the License. You may obtain a copy of
06: * the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13: * License for the specific language governing permissions and limitations under
14: * the License.
15: */
16: package com.google.gwt.xml.client;
17:
18: /*
19: * Implementation notes: Opera has a length limit of 32k on any <code>CharacterData</code>
20: * nodes.
21: */
22:
23: /**
24: * This interface describes <code>CharacterData</code> XML nodes. These can be
25: * either <code>Text</code>, <code>CDATASection</code> or
26: * <code>Comment</code> nodes.
27: */
28: public interface CharacterData extends Node {
29: /**
30: * This method appends <code>data</code> to the data in this
31: * <code>CharacterData</code>.
32: *
33: * @param appendedData the data to be appended to the end
34: */
35: public void appendData(String appendedData);
36:
37: /**
38: * This method deletes data, starting at <code>offset</code>, and deleting
39: * <code>count</code> characters.
40: *
41: * @param offset how far from the beginning to start deleting
42: * @param count how many characters to delete
43: */
44: public void deleteData(int offset, int count);
45:
46: /**
47: * This method retrieves the data.
48: *
49: * @return the data of this <code>CharacterData</code>
50: */
51: public String getData();
52:
53: /**
54: * This method retrieves the length of the data.
55: *
56: * @return the length of the data contained in this <code>CharacterData</code>
57: */
58: public int getLength();
59:
60: /**
61: * This method inserts data at the specified offset.
62: *
63: * @param offset how far from the beginning to start inserting
64: * @param insertedData the data to be inserted
65: */
66: public void insertData(int offset, String insertedData);
67:
68: /**
69: * This method replaces the substring of data indicated by <code>offset</code>
70: * and <code>count</code> with <code>replacementData</code>.
71: *
72: * @param offset how far from the beginning to start the replacement
73: * @param replacementData the data that will replace the deleted data
74: * @param count how many characters to delete before inserting
75: * <code>replacementData</code>
76: */
77: public void replaceData(int offset, int count,
78: String replacementData);
79:
80: /**
81: * This method sets the data to <code>data</code>.
82: *
83: * @param data the new data
84: */
85: public void setData(String data);
86:
87: /**
88: * This method gets a substring of the character data.
89: *
90: * @param offset the place to start the substring
91: * @param count how many characters to return
92: * @return the specified substring
93: */
94: public String substringData(int offset, int count);
95:
96: }
|