comparison dwtx/jface/internal/text/revisions/HunkComputer.d @ 158:25f1f92fa3df

...
author Frank Benoit <benoit@tionex.de>
date Tue, 26 Aug 2008 02:46:34 +0200
parents f70d9508c95c
children c3583c6ec027
comparison
equal deleted inserted replaced
157:7f75eaa8103a 158:25f1f92fa3df
30 import dwtx.jface.text.source.ILineDiffer; 30 import dwtx.jface.text.source.ILineDiffer;
31 31
32 32
33 /** 33 /**
34 * Computes the diff hunks from an {@link ILineDiffer}. 34 * Computes the diff hunks from an {@link ILineDiffer}.
35 * 35 *
36 * @since 3.3 36 * @since 3.3
37 */ 37 */
38 public final class HunkComputer { 38 public final class HunkComputer {
39 /** 39 /**
40 * Converts the line-based information of {@link ILineDiffer} into {@link Hunk}s, grouping 40 * Converts the line-based information of {@link ILineDiffer} into {@link Hunk}s, grouping
41 * contiguous blocks of lines that are changed (added, deleted). 41 * contiguous blocks of lines that are changed (added, deleted).
42 * 42 *
43 * @param differ the line differ to query 43 * @param differ the line differ to query
44 * @param lines the number of lines to query 44 * @param lines the number of lines to query
45 * @return the corresponding {@link Hunk} information 45 * @return the corresponding {@link Hunk} information
46 */ 46 */
47 public static Hunk[] computeHunks(ILineDiffer differ, int lines) { 47 public static Hunk[] computeHunks(ILineDiffer differ, int lines) {
80 hunks.add(new Hunk(lines - changed, added, changed)); 80 hunks.add(new Hunk(lines - changed, added, changed));
81 added= 0; 81 added= 0;
82 changed= 0; 82 changed= 0;
83 } 83 }
84 } 84 }
85 85
86 return (Hunk[]) hunks.toArray(new Hunk[hunks.size()]); 86 return arraycast!(Hunk)( hunks.toArray());
87 } 87 }
88 private this() { 88 private this() {
89 } 89 }
90 } 90 }