org.stringtemplate.v4.misc
Class ArrayIterator

java.lang.Object
  extended by org.stringtemplate.v4.misc.ArrayIterator
All Implemented Interfaces:
Iterator

public class ArrayIterator
extends Object
implements Iterator

Iterator for an array so I don't have to copy the array to a List just to make it iteratable.


Field Summary
protected  Object array
           
protected  int i
          Index into the data array
protected  int n
          Arrays are fixed size; precompute.
 
Constructor Summary
ArrayIterator(Object array)
           
 
Method Summary
 boolean hasNext()
           
 Object next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

i

protected int i
Index into the data array


array

protected Object array

n

protected int n
Arrays are fixed size; precompute.

Constructor Detail

ArrayIterator

public ArrayIterator(Object array)
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator

next

public Object next()
Specified by:
next in interface Iterator

remove

public void remove()
Specified by:
remove in interface Iterator


Copyright © 2011. All Rights Reserved.