Mercurial > hg4j
annotate src/org/tmatesoft/hg/internal/LineImpl.java @ 676:3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
| author | Artem Tikhomirov <tikhomirov.artem@gmail.com> | 
|---|---|
| date | Thu, 18 Jul 2013 18:03:51 +0200 | 
| parents | |
| children | 1c49c0cee540 | 
| rev | line source | 
|---|---|
| 676 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 1 /* | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 2 * Copyright (c) 2013 TMate Software Ltd | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 3 * | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 4 * This program is free software; you can redistribute it and/or modify | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 5 * it under the terms of the GNU General Public License as published by | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 6 * the Free Software Foundation; version 2 of the License. | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 7 * | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 8 * This program is distributed in the hope that it will be useful, | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 11 * GNU General Public License for more details. | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 12 * | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 13 * For information on how to redistribute this software under | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 14 * the terms of a license other than GNU General Public License | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 15 * contact TMate Software at support@hg4j.com | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 16 */ | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 17 package org.tmatesoft.hg.internal; | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 18 | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 19 import org.tmatesoft.hg.core.HgAnnotateCommand.LineInfo; | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 20 | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 21 /** | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 22 * @author Artem Tikhomirov | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 23 * @author TMate Software Ltd. | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 24 */ | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 25 final class LineImpl implements LineInfo { | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 26 private int ln; | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 27 private int rev; | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 28 private byte[] content; | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 29 | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 30 void init(int line, int csetRev, byte[] cnt) { | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 31 ln = line; | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 32 rev = csetRev; | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 33 content = cnt; | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 34 } | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 35 | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 36 public int getLineNumber() { | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 37 return ln; | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 38 } | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 39 | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 40 public int getChangesetIndex() { | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 41 return rev; | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 42 } | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 43 | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 44 public byte[] getContent() { | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 45 return content; | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 46 } | 
| 
3219cfadda49
Switch to alternative annotate producer (walks from parents to children). Refactor FileAnnotation to match updated annotate approach
 Artem Tikhomirov <tikhomirov.artem@gmail.com> parents: diff
changeset | 47 } | 
