org.apache.wicket.markup.repeater.util
Class ArrayIteratorAdapter<T>

java.lang.Object
  extended by org.apache.wicket.markup.repeater.util.ArrayIteratorAdapter<T>
Type Parameters:
T - type of array element
All Implemented Interfaces:
Iterator<IModel<T>>

public abstract class ArrayIteratorAdapter<T>
extends Object
implements Iterator<IModel<T>>

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(T[] array)
          Constructor
 
Method Summary
 boolean hasNext()
           
protected abstract  IModel<T> model(T object)
          This method is used to wrap the provided object with an implementation of IModel.
 IModel<T> 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(T[] array)
Constructor

Parameters:
array -
Method Detail

remove

public void remove()
Specified by:
remove in interface Iterator<IModel<T>>
See Also:
Iterator.remove()

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<IModel<T>>
See Also:
Iterator.hasNext()

next

public IModel<T> next()
Specified by:
next in interface Iterator<IModel<T>>
See Also:
Iterator.next()

reset

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


model

protected abstract IModel<T> model(T 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-2011 Apache Software Foundation. All Rights Reserved.