1 36 37 40 41 48 49 class SortAlgorithm { 50 53 private SortItem parent; 54 55 58 protected boolean stopRequested = false; 59 60 63 public void setParent(SortItem p) { 64 parent = p; 65 } 66 67 70 protected void pause() throws Exception { 71 if (stopRequested) { 72 throw new Exception ("Sort Algorithm"); 73 } 74 parent.pause(parent.h1, parent.h2); 75 } 76 77 80 protected void pause(int H1) throws Exception { 81 if (stopRequested) { 82 throw new Exception ("Sort Algorithm"); 83 } 84 parent.pause(H1, parent.h2); 85 } 86 87 90 protected void pause(int H1, int H2) throws Exception { 91 if (stopRequested) { 92 throw new Exception ("Sort Algorithm"); 93 } 94 parent.pause(H1, H2); 95 } 96 97 100 public void stop() { 101 stopRequested = true; 102 } 103 104 107 public void init() { 108 stopRequested = false; 109 } 110 111 115 void sort(int a[]) throws Exception { 116 } 117 } 118 | Popular Tags |