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;
13 import java.util.ArrayList;
15 public class WorkQueue {
17 ArrayList needsCompileList;
19 ArrayList compiledList;
22 this.needsCompileList = new ArrayList(11);
23 this.compiledList = new ArrayList(11);
26 public void add(SourceFile element) {
27 needsCompileList.add(element);
30 public void addAll(SourceFile[] elements) {
31 for (int i = 0, l = elements.length; i < l; i++)
36 this.needsCompileList.clear();
37 this.compiledList.clear();
40 public void finished(SourceFile element) {
41 needsCompileList.remove(element);
42 compiledList.add(element);
45 public boolean isCompiled(SourceFile element) {
46 return compiledList.contains(element);
49 public boolean isWaiting(SourceFile element) {
50 return needsCompileList.contains(element);
53 public String toString() {
54 return "WorkQueue: " + needsCompileList; //$NON-NLS-1$