Example usage for org.apache.wicket.util.collections ReadOnlyIterator ReadOnlyIterator

List of usage examples for org.apache.wicket.util.collections ReadOnlyIterator ReadOnlyIterator

Introduction

In this page you can find the example usage for org.apache.wicket.util.collections ReadOnlyIterator ReadOnlyIterator.

Prototype

ReadOnlyIterator

Source Link

Usage

From source file:org.wicketstuff.js.ext.ItemsRepeater.java

License:Apache License

@Override
protected Iterator<? extends Component> renderIterator() {
    final int iterations = size();
    return new ReadOnlyIterator<Component>() {
        private int index = 0;

        public boolean hasNext() {
            return index < iterations;
        }//from ww w .  j a v  a 2s . co m

        public Component next() {
            return get(Integer.toString(index++));
        }
    };
}