public static <T> void process(DefaultProgressTracker<T> tracker, TrackedProcessor processor, Iterable<T> i) throws Exception { tracker.starting(-1); doProcess(tracker, processor, i); }
public static <T> void process(DefaultProgressTracker<T> tracker, TrackedProcessor processor, Collection<T> col) throws Exception { tracker.starting(col.size()); doProcess(tracker, processor, col); }
public static <T> void process(DefaultProgressTracker<T> tracker, TrackedProcessor processor, T[] arr) throws Exception { tracker.starting(arr.length); doProcess(tracker, processor, Arrays.asList(arr)); }
private static void trackVolume(final long totalVolume, DefaultProgressTracker<Long> tracker) throws InterruptedException { System.out.println(); System.out.println("total volume " + tracker.totalVolume); System.out.println("actual pulse " + tracker.pulsePct); System.out.println("pulse volume " + tracker.pulseAtVolume); System.out.println("min pulse ms " + tracker.minPulseInterval/1000000); System.out.println(); //for(int i = 0; i < totalVolume; ++i) { // tracker.progressed(); //} tracker.starting(totalVolume); int i = 0; while(true) { tracker.processing((long)i); tracker.processed((long)i); if(++i >= totalVolume) { break; } Thread.currentThread().sleep(500 - i*10); } tracker.complete(); }
private static void trackFlow(final long totalVolume, DefaultProgressTracker<Long> tracker) throws InterruptedException { System.out.println(); System.out.println("total volume " + tracker.totalVolume); System.out.println("actual pulse " + tracker.pulsePct); System.out.println("pulse volume " + tracker.pulseAtVolume); System.out.println("min pulse ms " + tracker.minPulseInterval/1000000); System.out.println(""); //for(int i = 0; i < totalVolume; ++i) { // tracker.progressed(); //} tracker.starting(totalVolume); int i = 0; while(true) { tracker.processing((long)i); tracker.processed((long)i); if(++i >= totalVolume) { break; } Thread.currentThread().sleep(500 - i*10); } tracker.complete(); } }