1 21 22 package org.armedbear.j; 23 24 import java.util.Iterator ; 25 import java.util.NoSuchElementException ; 26 27 public final class EditorIterator implements Iterator 28 { 29 private Iterator it; 30 31 public EditorIterator() 32 { 33 this(Editor.getEditorList().iterator()); 34 } 35 36 public EditorIterator(Iterator it) 37 { 38 Debug.assertTrue(it != null); 39 Debug.assertFalse(it instanceof EditorIterator); 40 this.it = it; 41 } 42 43 public boolean hasNext() 44 { 45 return it.hasNext(); 46 } 47 48 public Object next() 49 { 50 return it.next(); 51 } 52 53 public Editor nextEditor() 54 { 55 return (Editor) it.next(); 56 } 57 58 public void remove() 59 { 60 throw new UnsupportedOperationException (); 61 } 62 } 63 | Popular Tags |