net.sf.statcvs.model
Class FileCountIterator

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

public class FileCountIterator
extends java.lang.Object

A customized iterator, which provides a date-sorted list of all dates where the number of files changed. It can be used to create a file count timeline for a given set of files

This iterator iterates on a list of files.

Version:
$Id:$
Author:
Lukasz Pekacki

Constructor Summary
FileCountIterator(java.util.Iterator aFileIterator)
          Creates a new FileCountIterator for the source file set.
 
Method Summary
 java.util.Date getDate()
          Returns the date of the current change event.
 int getFileCountDifference()
          Returns the difference of file count for the current date next() must be called once before the first event can be accessed.
 boolean hasNext()
          Returns true if there are more changes.
 void next()
          Advances the internal pointer to the next record
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileCountIterator

public FileCountIterator(java.util.Iterator aFileIterator)
Creates a new FileCountIterator for the source file set. The source set does not have to be sorted by date.

Parameters:
aFileIterator - an Iterator containt CvsFile objects that should be included in the file count 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 void next()
Advances the internal pointer to the next record


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

getFileCountDifference

public int getFileCountDifference()
                           throws java.util.NoSuchElementException
Returns the difference of file count for the current date next() must be called once before the first event can be accessed.

Returns:
the difference in file number
Throws:
java.util.NoSuchElementException - if the iterator is empty or next() was not called