net.sf.statcvs.model
Class LinesOfCodeIterator

java.lang.Object
  extended bynet.sf.statcvs.model.LinesOfCodeIterator

public class LinesOfCodeIterator
extends java.lang.Object

A customized iterator, which provides a date-sorted list of all dates where the lines of code count changed. It can be used to create a lines of code graph for a given set of revisions.

This iterator iterates on a list of change event. Each change event has an associated date and a lines of code count, which is the sum of all files at that time.

Version:
$Id: LinesOfCodeIterator.java,v 1.19 2003/03/18 10:33:55 lukasz Exp $
Author:
Anja Jentzsch, Richard Cyganiak

Constructor Summary
LinesOfCodeIterator(RevisionIterator source)
          Creates a new LinesOfCodeIterator for the source revision set.
 
Method Summary
 java.util.Date getDate()
          Returns the date of the current change event.
 int getLinesOfCode()
          Returns the lines of code count for the current change event.
 boolean hasNext()
          Returns true if there are more changes.
 boolean next()
          Advances the internal pointer to the next record, and returns true if there is such a record.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinesOfCodeIterator

public LinesOfCodeIterator(RevisionIterator source)
Creates a new LinesOfCodeIterator for the source revision set. The source set does not have to be sorted by date.

Parameters:
source - the RevisionIterator which contains the revisions that should be included in the lines of code calculation.
Method Detail

hasNext

public boolean hasNext()
Returns true if there are more changes. This does not advance the internal pointer.

Returns:
true if another entry can be accessed by next()

next

public boolean next()
Advances the internal pointer to the next record, and returns true if there is such a record.

Returns:
true if a record is accessible

getLinesOfCode

public int getLinesOfCode()
                   throws java.util.NoSuchElementException
Returns the lines of code count for the current change event. next() must be called once before the first event can be accessed.

Returns:
the lines of code count for the current change event.
Throws:
java.util.NoSuchElementException - if the iterator is empty or next() was not called

getDate

public java.util.Date getDate()
                       throws java.util.NoSuchElementException
Returns the date of the current change event. next() must be called once before the first event can be accessed.

Returns:
the date of the current change event.
Throws:
java.util.NoSuchElementException - if the iterator is empty or next() was not called