@ Override public Iterator < Object > iterator ( ) { return new Iterator < Object > ( ) { int currentPosition = 0 ; @ Override public boolean hasNext ( ) { return masterSequence . size ( ) > currentPosition ; } @ Override public Object next ( ) { if ( currentPosition <= masterSequence . size ( ) ) return masterSequence . get ( currentPosition ++ ) ; return null ; } @ Override public void remove ( ) { throw new UnsupportedOperationException ( "Remove is not supported." ) ; } } ; }
Retrieves an iterator for the sequence .