net.sf.statcvs.model
Class ListRevisionIterator

java.lang.Object
  extended by net.sf.statcvs.model.ListRevisionIterator
All Implemented Interfaces:
RevisionIterator
Direct Known Subclasses:
RevisionSortIterator

public class ListRevisionIterator
extends java.lang.Object
implements RevisionIterator

Provides a RevisionIterator on a List of CvsRevisions.

Version:
$Id: ListRevisionIterator.java,v 1.5 2003/03/18 10:33:55 lukasz Exp $
Author:
Richard Cyganiak

Constructor Summary
protected ListRevisionIterator()
          Helper constructor which is present to simplify subclassing
  ListRevisionIterator(java.util.List revisions)
          Creates a new instance from a List of CvsRevision objects.
 
Method Summary
protected  java.util.List getList()
          Returns the list of CvsRevision objects on which the iterator is based.
 boolean hasNext()
          Returns true if this iteration has more elements.
protected  void initList(java.util.List revisions)
          Inits the iterator with a List of CvsRevision objects.
protected  void initListFromIterator(RevisionIterator source)
          Inits the iterator with a RevisionIterator object.
 CvsRevision next()
          Returns the next cvs revision or otherwise a NoSuchElementException is thrown.
 void reset()
          Resets this iteration to the first element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListRevisionIterator

protected ListRevisionIterator()
Helper constructor which is present to simplify subclassing


ListRevisionIterator

public ListRevisionIterator(java.util.List revisions)
Creates a new instance from a List of CvsRevision objects. The ListRevisionIterator provides access to the list entries.

Parameters:
revisions - a list of revisions
Method Detail

initList

protected void initList(java.util.List revisions)
Inits the iterator with a List of CvsRevision objects.

Parameters:
revisions - a list of revision objects

initListFromIterator

protected void initListFromIterator(RevisionIterator source)
Inits the iterator with a RevisionIterator object.

Parameters:
source - a source revision iterator

getList

protected java.util.List getList()
Returns the list of CvsRevision objects on which the iterator is based.

Returns:
a list of revisions

hasNext

public boolean hasNext()
Description copied from interface: RevisionIterator
Returns true if this iteration has more elements.

Specified by:
hasNext in interface RevisionIterator
Returns:
True, if there are more revisions
See Also:
RevisionIterator.hasNext()

next

public CvsRevision next()
Description copied from interface: RevisionIterator
Returns the next cvs revision or otherwise a NoSuchElementException is thrown.

Specified by:
next in interface RevisionIterator
Returns:
The next revision
See Also:
RevisionIterator.next()

reset

public void reset()
Description copied from interface: RevisionIterator
Resets this iteration to the first element.

Specified by:
reset in interface RevisionIterator
See Also:
RevisionIterator.reset()