com.neeve.lang
Class XStringArrayIterator

java.lang.Object
  extended by com.neeve.lang.XArrayIterator<String>
      extended by com.neeve.lang.XStringArrayIterator
All Implemented Interfaces:
XIterator<String>, XStringIterator, Iterator<String>

public class XStringArrayIterator
extends XArrayIterator<String>
implements XStringIterator

An XArrayIterator implementing XStringIterator


Constructor Summary
XStringArrayIterator(String[] array)
          Constructs a new array iterator.
XStringArrayIterator(String[] array, int offset, int length)
          Constructs a new array iterator.
 
Method Summary
 void nextInto(XString to)
          Copies the next value into the provided XString.
 
Methods inherited from class com.neeve.lang.XArrayIterator
array, hasNext, length, next, offset, remove, toFirst
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.neeve.lang.XIterator
toFirst
 
Methods inherited from interface java.util.Iterator
hasNext, next, remove
 

Constructor Detail

XStringArrayIterator

public XStringArrayIterator(String[] array)
Constructs a new array iterator.

Parameters:
array - The array to iterate.

XStringArrayIterator

public XStringArrayIterator(String[] array,
                            int offset,
                            int length)
Constructs a new array iterator.

Parameters:
array - The backing array.
offset - The offset into the array.
length - The length the number of elements including the offset to iterate.
Method Detail

nextInto

public final void nextInto(XString to)
Description copied from interface: XStringIterator
Copies the next value into the provided XString.

This call has the same semantics as Iterator.next() except that the iterator implementation may be able to avoid allocating a String object.

While this method is provided in support of zero garbage iteration it is implementation depend as to whether or not this call is zero garbage.

Specified by:
nextInto in interface XStringIterator


Copyright © 2016 Neeve Research, LLC. All Rights Reserved.