1 34 package org.dspace.checker; 35 36 import java.util.Collections ; 37 import java.util.EmptyStackException ; 38 import java.util.List ; 39 import java.util.Stack ; 40 41 49 public class ListDispatcher implements BitstreamDispatcher 50 { 51 54 Stack bitstreams = new Stack (); 55 56 59 private ListDispatcher() 60 { 61 ; 62 } 63 64 70 public ListDispatcher(List bitstreamIds) 71 { 72 Collections.reverse(bitstreamIds); 73 bitstreams.addAll(bitstreamIds); 74 } 75 76 79 public synchronized int next() 80 { 81 try 82 { 83 return ((Integer ) bitstreams.pop()).intValue(); 84 } 85 catch (EmptyStackException e) 86 { 87 return SENTINEL; 88 } 89 } 90 } 91 | Popular Tags |