1 19 20 25 26 package soot.jimple.toolkits.annotation.arraycheck; 27 28 import java.util.*; 29 30 33 class BoundedPriorityList 34 { 35 private List fulllist; 36 private LinkedList worklist; 37 38 public BoundedPriorityList(List list) 39 { 40 this.fulllist = list; 41 this.worklist = new LinkedList(list); 42 } 43 44 public boolean isEmpty() 45 { 46 return worklist.isEmpty(); 47 } 48 49 public Object removeFirst() 50 { 51 return worklist.removeFirst(); 52 } 53 54 public void add(Object toadd) 55 { 56 57 int index = fulllist.indexOf(toadd); 58 59 int i = 0; 60 int size = worklist.size(); 61 62 for (; i<size; i++) 63 { 64 Object tocomp = worklist.get(i); 65 int tmpidx = fulllist.indexOf(tocomp); 66 if (index < tmpidx) 67 break; 68 } 69 70 worklist.add(i, toadd); 71 } 72 } 73 | Popular Tags |