Always use a single WindowCache for the entire JVM
[egit/imyousuf.git] / org.spearce.jgit / src / org / spearce / jgit / lib / IndexTreeVisitor.java
blob26f3a336244423fc03af92870d1052e79ee1db36
1 /*
2 * Copyright (C) 2007 David Watson <dwatson@mimvista.com>
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 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
18 package org.spearce.jgit.lib;
20 import java.io.File;
21 import java.io.IOException;
23 import org.spearce.jgit.lib.GitIndex.Entry;
25 /**
26 * Visitor interface for traversing the index and two trees in parallel.
28 * When merging we deal with up to two tree nodes and a base node. Then
29 * we figure out what to do.
31 * A File argument is supplied to allow us to check for modifications in
32 * a work tree or update the file.
34 public interface IndexTreeVisitor {
35 /**
36 * Visit a blob, and corresponding tree and index entries.
38 * @param treeEntry
39 * @param indexEntry
40 * @param file
41 * @throws IOException
43 public void visitEntry(TreeEntry treeEntry, Entry indexEntry, File file) throws IOException;
45 /**
46 * Visit a blob, and corresponding tree nodes and associated index entry.
48 * @param treeEntry
49 * @param auxEntry
50 * @param indexEntry
51 * @param file
52 * @throws IOException
54 public void visitEntry(TreeEntry treeEntry, TreeEntry auxEntry, Entry indexEntry, File file) throws IOException;
56 /**
57 * Invoked after handling all child nodes of a tree, during a three way merge
59 * @param tree
60 * @param auxTree
61 * @param curDir
62 * @throws IOException
64 public void finishVisitTree(Tree tree, Tree auxTree, String curDir) throws IOException;
66 /**
67 * Invoked after handling all child nodes of a tree, during two way merge.
69 * @param tree
70 * @param i
71 * @param curDir
72 * @throws IOException
74 public void finishVisitTree(Tree tree, int i, String curDir) throws IOException;