new version with WorkingCopy Management
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / core / builder / ClasspathMultiDirectory.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2003 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials 
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11 package net.sourceforge.phpdt.internal.core.builder;
12
13 import net.sourceforge.phpdt.core.compiler.CharOperation;
14
15 import org.eclipse.core.resources.IContainer;
16
17 class ClasspathMultiDirectory extends ClasspathDirectory {
18
19 IContainer sourceFolder;
20 char[][] exclusionPatterns; // used by builders when walking source folders
21 boolean hasIndependentOutputFolder; // if output folder is not equal to any of the source folders
22
23 ClasspathMultiDirectory(IContainer sourceFolder, IContainer binaryFolder, char[][] exclusionPatterns) {
24         super(binaryFolder, true);
25
26         this.sourceFolder = sourceFolder;
27         this.exclusionPatterns = exclusionPatterns;
28         this.hasIndependentOutputFolder = false;
29
30         // handle the case when a state rebuilds a source folder
31         if (this.exclusionPatterns != null && this.exclusionPatterns.length == 0)
32                 this.exclusionPatterns = null;
33 }
34
35 public boolean equals(Object o) {
36         if (this == o) return true;
37         if (!(o instanceof ClasspathMultiDirectory)) return false;
38
39         ClasspathMultiDirectory md = (ClasspathMultiDirectory) o;
40         return sourceFolder.equals(md.sourceFolder) && binaryFolder.equals(md.binaryFolder)
41                 && CharOperation.equals(exclusionPatterns, md.exclusionPatterns);
42
43
44 public String toString() {
45         return "Source classpath directory " + sourceFolder.getFullPath().toString() + //$NON-NLS-1$
46                 " with binary directory " + binaryFolder.getFullPath().toString(); //$NON-NLS-1$
47 }
48 }