1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package org.xwiki.annotation.maintainer.internal

File ChunksXDelta.java

 

Coverage histogram

../../../../../img/srcFileCovDistChart10.png
0% of files have more coverage

Code metrics

0
7
4
1
79
29
4
0.57
1.75
4
1

Classes

Class Line # Actions
ChunksXDelta 29 7 0% 4 0
1.0100%
 

Contributing tests

This file is covered by 46 tests. .

Source view

1    /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10    * This software is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this software; if not, write to the Free
17    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19    */
20    package org.xwiki.annotation.maintainer.internal;
21   
22    /**
23    * String chunks storage based implementation of the difference interface. It stores the original text and the updated
24    * one and returns them when functions are called.
25    *
26    * @version $Id: a414b24924a75e60f50fcd96f7983d98289b2f7d $
27    * @since 2.3M1
28    */
 
29    public class ChunksXDelta extends AbstractXDelta
30    {
31    /**
32    * The position where the modification takes place.
33    */
34    private int position;
35   
36    /**
37    * The original chunk at position.
38    */
39    private String original;
40   
41    /**
42    * The modified chunk at position.
43    */
44    private String edited;
45   
46    /**
47    * Creates a new XDelta from the passed values.
48    *
49    * @param position the position where the edit takes place
50    * @param original the original string at {@code position}
51    * @param edited the new string at {@code position}
52    */
 
53  62 toggle public ChunksXDelta(int position, String original, String edited)
54    {
55  62 super();
56  62 this.position = position;
57  62 this.original = original;
58  62 this.edited = edited;
59    }
60   
 
61  44 toggle @Override
62    public String getChanged()
63    {
64  44 return edited;
65    }
66   
 
67  106 toggle @Override
68    public String getOriginal()
69    {
70  106 return original;
71    }
72   
 
73  124 toggle @Override
74    public int getOffset()
75    {
76  124 return position;
77    }
78   
79    }