1 11 package org.eclipse.jdt.internal.core.builder; 12 13 import org.eclipse.jdt.internal.compiler.util.SimpleSet; 14 15 public class WorkQueue { 16 17 private SimpleSet needsCompileList; 18 private SimpleSet compiledList; 19 20 public WorkQueue() { 21 this.needsCompileList = new SimpleSet(); 22 this.compiledList = new SimpleSet(); 23 } 24 25 public void add(SourceFile element) { 26 needsCompileList.add(element); 27 } 28 29 public void addAll(SourceFile[] elements) { 30 for (int i = 0, l = elements.length; i < l; i++) 31 add(elements[i]); 32 } 33 34 public void clear() { 35 this.needsCompileList.clear(); 36 this.compiledList.clear(); 37 } 38 39 public void finished(SourceFile element) { 40 needsCompileList.remove(element); 41 compiledList.add(element); 42 } 43 44 public boolean isCompiled(SourceFile element) { 45 return compiledList.includes(element); 46 } 47 48 public boolean isWaiting(SourceFile element) { 49 return needsCompileList.includes(element); 50 } 51 52 public String toString() { 53 return "WorkQueue: " + needsCompileList; } 55 } 56 | Popular Tags |