KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > internal > ccvs > core > syncinfo > MultiTagResourceVariantTree


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.team.internal.ccvs.core.syncinfo;
12
13 import java.util.HashMap JavaDoc;
14 import java.util.Map JavaDoc;
15
16 import org.eclipse.core.resources.IResource;
17 import org.eclipse.core.runtime.Assert;
18 import org.eclipse.team.core.variants.ResourceVariantByteStore;
19 import org.eclipse.team.internal.ccvs.core.CVSTag;
20
21 /**
22  * A CVS resource variant tree that associates a different tag with each root project.
23  */

24 public class MultiTagResourceVariantTree extends CVSResourceVariantTree {
25
26     Map JavaDoc resources = new HashMap JavaDoc();
27     
28     public MultiTagResourceVariantTree(ResourceVariantByteStore cache, boolean cacheFileContentsHint) {
29         super(cache, null, cacheFileContentsHint);
30     }
31     
32     public void addResource(IResource resource, CVSTag tag) {
33         Assert.isNotNull(resource);
34         Assert.isNotNull(tag);
35         resources.put(resource, tag);
36     }
37     
38     /* (non-Javadoc)
39      * @see org.eclipse.team.internal.ccvs.core.syncinfo.CVSResourceVariantTree#getTag(org.eclipse.core.resources.IResource)
40      */

41     public CVSTag getTag(IResource resource) {
42         return (CVSTag)resources.get(resource);
43     }
44 }
45
Popular Tags