1 5 package prefuse.util.collections; 6 7 import java.util.NoSuchElementException ; 8 9 15 public class IntArrayIterator extends IntIterator { 16 17 private int[] m_array; 18 private int m_cur; 19 private int m_end; 20 21 public IntArrayIterator(int[] array, int start, int len) { 22 m_array = array; 23 m_cur = start; 24 m_end = start+len; 25 } 26 27 30 public int nextInt() { 31 if ( m_cur >= m_end ) 32 throw new NoSuchElementException (); 33 return m_array[m_cur++]; 34 } 35 36 39 public boolean hasNext() { 40 return m_cur < m_end; 41 } 42 43 public void remove() { 44 throw new UnsupportedOperationException (); 45 } 46 47 } | Popular Tags |