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
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package net.sourceforge.phpeclipse.builder;
13 import net.sourceforge.phpdt.core.compiler.CharOperation;
15 import org.eclipse.core.resources.IContainer;
17 class ClasspathMultiDirectory extends ClasspathDirectory {
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
23 ClasspathMultiDirectory(IContainer sourceFolder, IContainer binaryFolder, char[][] exclusionPatterns) {
24 super(binaryFolder, true);
26 this.sourceFolder = sourceFolder;
27 this.exclusionPatterns = exclusionPatterns;
28 this.hasIndependentOutputFolder = false;
30 // handle the case when a state rebuilds a source folder
31 if (this.exclusionPatterns != null && this.exclusionPatterns.length == 0)
32 this.exclusionPatterns = null;
35 public boolean equals(Object o) {
36 if (this == o) return true;
37 if (!(o instanceof ClasspathMultiDirectory)) return false;
39 ClasspathMultiDirectory md = (ClasspathMultiDirectory) o;
40 return sourceFolder.equals(md.sourceFolder) && binaryFolder.equals(md.binaryFolder)
41 && CharOperation.equals(exclusionPatterns, md.exclusionPatterns);
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$