org.apache.wicket.markup.repeater.util
Class ArrayIteratorAdapter

java.lang.Object
  extended by org.apache.wicket.markup.repeater.util.ArrayIteratorAdapter
All Implemented Interfaces:
java.util.Iterator

public abstract class ArrayIteratorAdapter
extends java.lang.Object
implements java.util.Iterator

Iterator over an array. Implementation must provide model(Object) method to wrap each item in a model before it is returned through next() method.

Author:
Igor Vaynberg (ivaynberg)

Constructor Summary
ArrayIteratorAdapter(java.lang.Object[] array)
          Constructor
 
Method Summary
 boolean hasNext()
           
protected abstract  IModel model(java.lang.Object object)
          This method is used to wrap the provided object with an implementation of IModel.
 java.lang.Object next()
           
 void remove()
           
 void reset()
          Resets the iterator position back to the beginning of the array
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayIteratorAdapter

public ArrayIteratorAdapter(java.lang.Object[] array)
Constructor

Parameters:
array -
Method Detail

remove

public void remove()
Specified by:
remove in interface java.util.Iterator
See Also:
Iterator.remove()

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator
See Also:
Iterator.hasNext()

next

public java.lang.Object next()
Specified by:
next in interface java.util.Iterator
See Also:
Iterator.next()

reset

public void reset()
Resets the iterator position back to the beginning of the array


model

protected abstract IModel model(java.lang.Object object)
This method is used to wrap the provided object with an implementation of IModel. The provided object is guaranteed to be returned from the delegate iterator.

Parameters:
object - object to be wrapped
Returns:
IModel wrapper for the object


Copyright © 2004-2010 Apache Software Foundation. All Rights Reserved.