Javadoc update for Egit
[egit.git] / org.spearce.egit.core / src / org / spearce / egit / core / internal / mapping / GitFileRevision.java
blobc309b9dc8a6ff130078798cf26c1876e0ecc834d
1 /*
2 * Copyright (C) 2006 Robin Rosenberg
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License, version 2.1, as published by the Free Software Foundation.
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
17 package org.spearce.egit.core.internal.mapping;
19 import java.net.URI;
21 import org.eclipse.core.resources.IResource;
22 import org.eclipse.core.runtime.CoreException;
23 import org.eclipse.core.runtime.IProgressMonitor;
24 import org.eclipse.team.core.history.IFileRevision;
25 import org.eclipse.team.core.history.provider.FileRevision;
26 import org.spearce.jgit.lib.ObjectId;
27 import org.spearce.jgit.lib.TopologicalSorter;
29 /**
30 * A Git related {@link IFileRevision}. It references a version
31 * and a resource, i.e. the version we think corresponds to the
32 * resource in specific version.
34 public abstract class GitFileRevision extends FileRevision {
36 private final IResource resource;
38 private final int count;
40 private TopologicalSorter<ObjectId>.Lane lane;
42 /**
43 * Construct a {@link GitFileRevision}
45 * @param resource
46 * @param count index into the full list of commits
48 public GitFileRevision(IResource resource, int count) {
49 this.count = count;
50 this.resource = resource;
53 public String getName() {
54 return resource.toString();
57 public boolean isPropertyMissing() {
58 return false;
61 public IFileRevision withAllProperties(IProgressMonitor monitor)
62 throws CoreException {
63 return this;
66 public URI getURI() {
67 return resource.getLocationURI();
70 /**
71 * @return the {@link IResource} the {@link IFileRevision} refers to.
73 public IResource getResource() {
74 return resource;
77 /**
78 * @deprecated
79 * @return index into full list of versions
81 public int getCount() {
82 return count;
85 /**
86 * @return the swim lane assigned by the graph layout
88 public TopologicalSorter<ObjectId>.Lane getLane() {
89 return lane;
92 /**
93 * Set the swim where this revision is found. Invoked by the
94 * graph layout.
96 * @param lane
98 public void setLane(TopologicalSorter<ObjectId>.Lane lane) {
99 this.lane = lane;
103 * @return the ObjectId this IFileRevision refers to.
105 public ObjectId getCommitId() {
106 return null;