net.sf.statcvs.model
Class RevisionLimitIterator

java.lang.Object
  extended by net.sf.statcvs.model.RevisionLimitIterator
All Implemented Interfaces:
RevisionIterator

public class RevisionLimitIterator
extends java.lang.Object
implements RevisionIterator

Returns only the first X entries from a RevisionIterator.

Version:
$Id: RevisionLimitIterator.java,v 1.3 2003/03/18 10:33:54 lukasz Exp $
Author:
Richard Cyganiak

Constructor Summary
RevisionLimitIterator(RevisionIterator source, int limit)
          Creates a new RevisionIterator which contains only the first limit entries of source.
 
Method Summary
 boolean hasNext()
          Returns true if this iteration has more elements.
 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

RevisionLimitIterator

public RevisionLimitIterator(RevisionIterator source,
                             int limit)
Creates a new RevisionIterator which contains only the first limit entries of source.

Parameters:
source - the source iterator
limit - the number of entries to keep
Method Detail

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()