1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 package org.openoffice.xmerge.merger.diff; 25 26 import org.w3c.dom.Node; 27 28 /** 29 * A small class to hold the start/end character position and the 30 * <code>Node</code> pointer in a text <code>Node</code>. It is 31 * mainly used for character parser to make a list of text 32 * <code>Node</code> cache entries. 33 * 34 * @author smak 35 */ 36 public class TextNodeEntry { 37 38 private int startChar_; 39 private int endChar_; 40 private Node node_; 41 42 /** 43 * Constructor 44 * 45 * @param startChar The start character position. 46 * @param endChar The end character position. 47 * @param node The text <code>Node</code>. 48 */ TextNodeEntry(int startChar, int endChar, Node node)49 public TextNodeEntry(int startChar, int endChar, Node node) { 50 startChar_ = startChar; 51 endChar_ = endChar; 52 node_ = node; 53 } 54 55 /** 56 * Returns the start character. 57 * 58 * @return The start character. 59 */ startChar()60 public int startChar() { 61 return startChar_; 62 } 63 64 65 /** 66 * Returns the end character. 67 * 68 * @return The end character. 69 */ endChar()70 public int endChar() { 71 return endChar_; 72 } 73 74 75 /** 76 * Returns the <code>Node</code>. 77 * 78 * @return The <code>Node</code>. 79 */ node()80 public Node node() { 81 return node_; 82 } 83 } 84 85