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.phpdt.internal.core.builder;
15 public class WorkQueue {
17 ArrayList needsCompileList;
18 ArrayList compiledList;
21 this.needsCompileList = new ArrayList(11);
22 this.compiledList = new ArrayList(11);
25 public void add(SourceFile element) {
26 needsCompileList.add(element);
29 public void addAll(SourceFile[] elements) {
30 for (int i = 0, l = elements.length; i < l; i++)
35 this.needsCompileList.clear();
36 this.compiledList.clear();
39 public void finished(SourceFile element) {
40 needsCompileList.remove(element);
41 compiledList.add(element);
44 public boolean isCompiled(SourceFile element) {
45 return compiledList.contains(element);
48 public boolean isWaiting(SourceFile element) {
49 return needsCompileList.contains(element);
52 public String toString() {
53 return "WorkQueue: " + needsCompileList; //$NON-NLS-1$