com.opensymphony.xwork.validator.validators
Class CollectionFieldValidator.CloneableIterator

java.lang.Object
  extended by com.opensymphony.xwork.validator.validators.CollectionFieldValidator.CloneableIterator
All Implemented Interfaces:
Cloneable, Iterator
Enclosing class:
CollectionFieldValidator

protected class CollectionFieldValidator.CloneableIterator
extends Object
implements Iterator, Cloneable

A cloneable iterator, when the iterator is cloned, its state is preserved, eg. when this iterator is iterated to its 2nd element and the iterator is cloned, the cloned iterator will start at its 3rd element as well when its {next() method is called.

Version:
$Date$ $Id$
Author:
tmjee

Field Summary
 int index
           
 
Constructor Summary
CollectionFieldValidator.CloneableIterator(List list)
          Create a CollectionFieldValidator.CloneableIterator based on the list supplied.
 
Method Summary
protected  Object clone()
          Clone this iterator, when the iterator is cloned, its state is preserved, eg.
 boolean hasNext()
          See if there's a next element pending.
 Object next()
          Go get the next element.
 void remove()
          This operation is NOT SUPPORTED, will throw UnsupportedOperationException if its invoked.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

index

public int index
Constructor Detail

CollectionFieldValidator.CloneableIterator

public CollectionFieldValidator.CloneableIterator(List list)
Create a CollectionFieldValidator.CloneableIterator based on the list supplied.

Parameters:
list -
Method Detail

hasNext

public boolean hasNext()
See if there's a next element pending.

Specified by:
hasNext in interface Iterator

next

public Object next()
Go get the next element.

Specified by:
next in interface Iterator

remove

public void remove()
This operation is NOT SUPPORTED, will throw UnsupportedOperationException if its invoked.

Specified by:
remove in interface Iterator

clone

protected Object clone()
                throws CloneNotSupportedException
Clone this iterator, when the iterator is cloned, its state is preserved, eg. when this iterator is iterated to its 2nd element and the iterator is cloned, the cloned iterator will start at its 3rd element as well when its {next() method is called.

Overrides:
clone in class Object
Throws:
CloneNotSupportedException

WebWork Project Page