View Javadoc

1   /*
2    * Copyright 1999-2006 Faculty of Mathematics, Physics and Informatics, Comenius
3    * University, Bratislava. This file is protected by the Mozilla Public License
4    * version 1.1 (the License); you may not use this file except in compliance
5    * with the License. You may obtain a copy of the License at
6    * http://euromath2.sourceforge.net/license.html Unless required by applicable
7    * law or agreed to in writing, software distributed under the License is
8    * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
9    * KIND, either express or implied. See the License for the specific language
10   * governing permissions and limitations under the License.
11   */
12  package sk.uniba.euromath.editor.textEditor;
13  
14  /***
15   * Interface to properties of text piece.
16   * 
17   * @author Tomáš Studva, Martin Kollár
18   */
19  public interface ITextPieceInfo {
20  
21      /***
22       * @deprecated ak sa ti to hodi pouzit informuj ma. Studva
23       * @param nodeID
24       * @param offset
25       * @param length
26       * @return bla bla
27       */
28      @Deprecated
29      public int contains(String nodeID, int offset, int length);
30  
31      /***
32       * Unique identification of this text piece in whole document.
33       * 
34       * @return id of this text piece
35       */
36      public String getID();
37  
38      /***
39       * Identification of node holding the text (text node, cdata node,
40       * attribute).
41       * 
42       * @return id of node containing this text
43       */
44      public String getNodeID();
45  
46      /***
47       * Index of the first character of this text piece in whole displayed text
48       * of textual node.
49       * 
50       * @return globaloffset of first character
51       */
52      public int getOffset();
53  
54      /***
55       * Index of the first character of this text piece in whole original text of
56       * textual node.
57       * 
58       * @return globaloffset of first character
59       */
60      public int getOriginalOffset();
61  
62      /***
63       * Index of last character of this text piece in whole displayed text
64       * 
65       * @return global offset of last character
66       */
67      public int getLastIndex();
68  
69      /***
70       * Length of the text piece.
71       * 
72       * @return length
73       */
74      public int getLength();
75  
76      /***
77       * Returns text of this text piece.
78       * 
79       * @return text value.
80       */
81      public String getText();
82  }