KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > google > gwt > xml > client > CharacterData


1 /*
2  * Copyright 2006 Google Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5  * use this file except in compliance with the License. You may obtain a copy of
6  * the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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 JavaDoc 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 JavaDoc 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 JavaDoc 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, String JavaDoc replacementData);
78
79   /**
80    * This method sets the data to <code>data</code>.
81    *
82    * @param data the new data
83    */

84   public void setData(String JavaDoc data);
85
86   /**
87    * This method gets a substring of the character data.
88    *
89    * @param offset the place to start the substring
90    * @param count how many characters to return
91    * @return the specified substring
92    */

93   public String JavaDoc substringData(int offset, int count);
94
95 }
Popular Tags