jdk/src/share/classes/com/sun/tools/jdi/EventSetImpl.java
changeset 51 6fe31bc95bbc
parent 2 90ce3da70b43
child 829 813b4d167747
child 715 f16baef3a20e
equal deleted inserted replaced
50:a437b3f9d7f4 51:6fe31bc95bbc
    54     private EventSetImpl internalEventSet;
    54     private EventSetImpl internalEventSet;
    55 
    55 
    56     public String toString() {
    56     public String toString() {
    57         String string = "event set, policy:" + suspendPolicy +
    57         String string = "event set, policy:" + suspendPolicy +
    58                         ", count:" + this.size() + " = {";
    58                         ", count:" + this.size() + " = {";
    59         Iterator iter = this.iterator();
       
    60         boolean first = true;
    59         boolean first = true;
    61         while (iter.hasNext()) {
    60         for (Event event : this) {
    62             Event event = (Event)iter.next();
       
    63             if (!first) {
    61             if (!first) {
    64                 string += ", ";
    62                 string += ", ";
    65             }
    63             }
    66             string += event.toString();
    64             string += event.toString();
    67             first = false;
    65             first = false;
   785     public int suspendPolicy() {
   783     public int suspendPolicy() {
   786         return EventRequestManagerImpl.JDWPtoJDISuspendPolicy(suspendPolicy);
   784         return EventRequestManagerImpl.JDWPtoJDISuspendPolicy(suspendPolicy);
   787     }
   785     }
   788 
   786 
   789     private ThreadReference eventThread() {
   787     private ThreadReference eventThread() {
   790         Iterator iter = this.iterator();
   788         for (Event event : this) {
   791         while (iter.hasNext()) {
       
   792             Event event = (Event)iter.next();
       
   793             if (event instanceof ThreadedEventImpl) {
   789             if (event instanceof ThreadedEventImpl) {
   794                 return ((ThreadedEventImpl)event).thread();
   790                 return ((ThreadedEventImpl)event).thread();
   795             }
   791             }
   796         }
   792         }
   797         return null;
   793         return null;
   844                 throw new NoSuchElementException();
   840                 throw new NoSuchElementException();
   845             }
   841             }
   846         }
   842         }
   847 
   843 
   848         public Event nextEvent() {
   844         public Event nextEvent() {
   849             return (Event)next();
   845             return next();
   850         }
   846         }
   851 
   847 
   852         public void remove() {
   848         public void remove() {
   853             throw new UnsupportedOperationException();
   849             throw new UnsupportedOperationException();
   854         }
   850         }